0

I want to make a GET request to an API. I have an API key but don't know how to implement it with my swift app. The API documentation says this:

"API requests must be made over HTTPS and be accompanied by an API Key sent via the X-IFL-API-Key header."

1 Answer 1

1

Use NSMutableURLRequest and simply add the header:

request.setValue(apiKey, forHTTPHeaderField: "X-IFL-API-Key")

You can find the documentation for NSMutableURLRequest here. Once you have created and configured your URL request, you can "invoke" it by using the various methods of NSURLSession.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.