我正在编写一个用于管理 Etsy 列表的 Mac 应用程序。我正在使用objective-c 和OauthConsumer 库。
我已成功获取身份验证令牌并检索到列表和类别。
现在我想创建一个列表。我创建了一个包含最少测试所需字段的字典。
这是调试输出。我刚刚修改了 oauth_token。
你能看到问题吗?谢谢
2016-08-28 12:31:09.042 商品[32465:16639890] 上市字典:{
params = {
"category_id" = 323;
description = "testing - not for sale";
"is_supply" = false;
price = 3000;
quantity = 1;
title = "testing - not for sale";
"when_made" = 1920s;
"who_made" = "someone_else";
};
}
2016-08-28 12:31:09.042 Goods[32465:16639890] jsonString: {"params":{"title":"testing - not for sale","when_made":"1920s","who_made":"someone_else ","quantity":"1","is_supply":"false","price":"3000","category_id":"323","description":"testing - not for sale"}}
2016-08-28 12:31:12.475 商品[32465:16639890] urlString: https://openapi.etsy.com/v2/listings/
2016-08-28 12:31:12.476 商品[32465:16639890] 请求:网址:https ://openapi.etsy.com/v2/listings/
所有HTTPHeaderFields:{
Authorization = "OAuth realm=\"\", oauth_consumer_key=\"b2ttpixxxxxxxxnciaubi8\", oauth_token=\"xxxxxxxxxxxx\", oauth_signature_method=\"HMAC-SHA1\", oauth_signature=\"NHSLUPAZyrtOrEI%2BAQCV9w74%2BIc%3D\", oauth_timestamp=\"1472409072\", oauth_nonce=\"BF3E6982-695E-4EF4-AD70-BDF8A401A65B\", oauth_version=\"1.0\"";
method = createListing;
}
_signatureBaseString: POST&https%3A%2F%2Fopenapi.etsy.com%2Fv2%2Flistings%2F&oauth_consumer_key%3Db2ttpia1jk3j2ijhnciaubi8%26oauth_nonce%3DBF3E6982-695E-4EF4-AD70-BDF8A401A65B%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1472409072%26oauth_token%3D840f745e22136b6351500b567ee6c9%26oauth_version% 3D1.0
2016-08-28 12:31:12.476 商品[32465:16639890] configuration.HTTPAdditionalHeaders: (null)
2016-08-28 12:31:12.477 商品[32465:16639890] etsyItem:
2016-08-28 12:31:13.069 商品[32465:16640021] statusCode: 403
2016-08-28 12:31:13.069 商品[32465:16640021] hTTPURLResponse.allHeaderFields: {
"Cache-Control" = private;
Connection = close;
"Content-Length" = 766;
"Content-Type" = "text/plain;charset=UTF-8";
Date = "Sun, 28 Aug 2016 18:31:13 GMT";
Server = Apache;
"X-Cnection" = close;
"X-Error-Detail" = "oauth_problem=signature_invalid&debug_sbs=POST&https%3A%2F%2Fopenapi.etsy.com%2Fv2%2Flistings%2F&oauth_consumer_key%3Db2ttpia1jk3j2ijhnciaubi8%26oauth_nonce%3DBF3E6982-695E-4EF4-AD70-BDF8A401A65B%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1472409072%26oauth_token%3D840f745e22136b6351500b567ee6c9%26oauth_version%3D1.0%26%257B%2522params%2522%253A%257B%2522title%2522%253A%2522testing_-_not_for_sale%2522%252C%2522when_made%2522%253A%25221920s%2522%252C%2522who_made%2522%253A%2522someone_else%2522%252C%2522quantity%2522%253A%25221%2522%252C%2522is_supply%2522%253A%2522false%2522%252C%2522price%2522%253A%25223000%2522%252C%2522category_id%2522%253A%2522323%2522%252C%2522description%2522%253A%2522testing_-_not_for_sale%2522%257D%257D%3D";
"X-Etsy-Request-Uuid" = 084ELjPQBbhJzUjLaOa3XxHVfwSh;
}