How to use header key from the api to authenticate URL in iOS Swift?
<p>I am using Alamofire for the HTTP networking in my app. But in my api which is written in python have an header key for getting request, if there is a key then only give response. Now I want to use that header key in my iOS app with Alamofire, I am not getting it how to implement. Below is my code of normal without any key implementation:</p>

<pre><code>Alamofire.request(.GET,"http://name/user_data/\(userName)@someURL.com").responseJSON { response in // 1
        print(response.request)  // original URL request
        print(response.response) // URL response
        print(response.data)     // server data
        print(response.result) 
}
</code></pre>

<p>I have a key as "appkey" and value as a "test" in my api. If anyone can help. Thank you!</p>

<pre><code>let headers: HTTPHeaders = [
    "Accept": "application/json",
    "appkey": "test"
]

Alamofire.request("http://name/user_data/\(userName)@someURL.com", headers: headers).responseJSON { response in
    print(response.request)  // original URL request
    print(response.response) // URL response
    print(response.data)     // server data
    print(response.result) 
}
</code></pre>

python ios swift alamofire