我需要通过泽西客户端为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头。该请求工作正常在邮递员(铬平安客户端扩展)具有相同的标题
需要帮助。