我需要通過澤西客戶端爲REST調用設置這些標頭。 的Clickate消息發送REST調用針對平針織客戶端請求標頭的錯誤?
curl -i \
-X POST \
-H "X-Version: 1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Your Authorization Token" \
-H "Accept: application/json" \
我的代碼是:
Client client = Client.create();
WebResource webResource = client.resource("https://api.clickatell.com/rest/message");
ClientResponse response = webResource
.header("Authorization", "Bearer clickATellAuthKey")
.header("X-Version", "1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.post(ClientResponse.class, input);
我收到此錯誤:
{"error":{"code":"001","description":"Authentication failed","documentation":" http://www.clickatell.com/help/apidocs/error/001.htm "}}
文件說沒有指定AUTH頭。該請求工作正常在郵遞員(鉻平安客戶端擴展)具有相同的標題
需要幫助。