這是返回的錯誤代碼401
或500
。有人能幫助我,我哪裏出錯了嗎?CppRestSDK https請求不起作用
http_client client(L"https://oxford-speech.cloudapp.net/token/issueToken/");
uri_builder query;
query.append_query(L"grant_type", L"client_credentials");
query.append_query(L"client_id", L"test-app");
query.append_query(L"client_secret", L"<client secret goes here>");
query.append_query(L"scope", L"https://speech.platform.bing.com");
query.append_query(L"content_type", L"application/x-www-form-urlencoded");
http_request msg(methods::POST);
msg.headers().set_content_type(L"application/x-www-form-urlencoded");
msg.set_request_uri(query.to_string());
std::wstring str = msg.to_string();
return client.request(msg);
我刪除了您的客戶端密鑰,您可能需要重新生成它。 –
謝謝。沒有得到理由,雖然相同的查詢適用於其他JS clinet! – ryadav