我有以下的代碼,但一直得到錯誤401禁止試圖運行它時:401斯威夫特和Mailgun
的錯誤是:
url = https://api.mailgun.net/v3/{edited_out}/messages
response = <NSHTTPURLResponse: 0x600000226a20> { URL: https://api.mailgun.net/v3/{edited_out}/messages } { status code: 401, headers {
Connection = "keep-alive";
"Content-Length" = 9;
"Content-Type" = "text/html; charset=utf-8";
Date = "Thu, 29 Dec 2016 21:22:46 GMT";
Server = nginx;
"Www-Authenticate" = "Basic realm=\"MG API\"";
} }
response code = 401
如果我送這樣的請求通過curl與我的憑據工作正常。
任何想法?
這是一個身份驗證錯誤,你應該通過正確的憑據 –
我傳遞正確的信息。他們通過捲曲做工精細 – RJH
你能告訴你正在使用curl命令哪個有效? – jtbandes