how to set the authorization token based on this curl?

馋奶兔 提交于 2019-12-12 02:25:49

问题


I want add a token for Authorisation to the header. Here it is the curl that my backend ask me to set before any interaction:

curl -H 'Authorization: Token token="replace-with-token"' http://domain.com/topic

here is my code:

 [config setHTTPAdditionalHeaders:@{@"Authorization":@"token=\"4959a0bc00a15e335fb6\""}];

I keep getting "HTTP Token: Access denied." does any one know reason?


回答1:


I believe it would be this?:

[config setHTTPAdditionalHeaders:@{@"Authorization":@"Token token=\"4959a0bc00a15e335fb6\""}];


来源:https://stackoverflow.com/questions/31344118/how-to-set-the-authorization-token-based-on-this-curl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!