Translating cURL into Swift NSURLSession <p>I am working with the Twilio API to perform a lookup with a phone number. I have an SID &amp; API token, and the example call gives me this cURL command:</p> <pre><code>curl -XGET "https://lookups.twilio.com/v1/PhoneNumbers/4192240117?Type=carrier&amp;Type=caller-name" -u "{AccountSid}:{AuthToken}" </code></pre> <p>However, I'm not sure how to translate that into a valid URL when creating my NSURLSession. </p> <p>Does the <code>AccountSID</code> &amp; <code>AuthToken</code> token go into the header of the request, or are they parameters to the request?</p> <p>I have tried adding them as both, using the awesome Paw app, to see if I could get it working, but I have not been able to. </p> <p>I have tried searching Google for what the <code>-u</code> command is in cURL, so I added the <code>username</code> &amp; <code>password</code> fields in the request header with the appropriate key, but no luck. </p> <p>Can anyone explain where I need to put <code>AccountSID</code> &amp; <code>AuthToken</code> in the URL to successfully make the request?</p>