POST action results in "Invalid http header"
まだ誰も着手していません。
評価
調査の方向性
まず、C# の getObjects メソッドに示されているリクエストを再現し、動作する curl コマンドと比較します。API に対して、リクエストヘッダーとレスポンスの意図された動作を確認します。GET がヘッダーエラーなしで要求されたメタデータを返せば、issue は完了です。
索引モデルが issue の本文から書いたものです。
説明
I am trying to execute a GET command so I get can get data from a server. The Curl below works in Postman.
$ curl -X GET -H "Authorization: {SESSION_ID}"
https://{server}/api/{version}/metadata/vobjects
While running my code, I am able to get the session ID. The next step is to get the data. But when I execute the GET, I don't get any response. Instead a I get an error as follows: "Specified value has invalid HTTP Header characters. (Parameter 'name')"
Below is the C# code I am trying to execute
_
public static void getObjects(string sessionID)
{
var client = new RestClient("https://generic-server.com/api/v20.3/metadata/vobjects/");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization:", sessionID);
IRestResponse response = client.Execute(request);
Console.WriteLine("Here's the response: " + response.Content + " " + response.Content.Length);
Console.WriteLine("Here's the error message: " + response.ErrorMessage);
}
_
response.ErrorMessage gives the following:
Here's the error message: Specified value has invalid HTTP Header characters. (Parameter 'name')
Note: When I leave the colon out of of the header, then I get the following response from the server:
{"responseStatus":"FAILURE","errors":[{"type":"INVALID_DATA","message":"Invalid http header [Accept: application/json, text/json, text/x-json, text/javascript, application/xml, text/xml]"}]} 190
Does anyone have any thoughts
- 主要言語
- PowerShell
- スター
- 11.2k
- フォーク
- 9.1k
- 平均マージ
- 2日 7時間
- マージ済み PR(30日)
- 14
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/sql-server-samples のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
microsoft/sql-server-samples#1499 ·
-
難易度 1/5 1〜3時間 初心者へのやさしさ 76/100
microsoft/sql-server-samples#1495 · リアクション 3 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
microsoft/sql-server-samples#1341 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 64/100
microsoft/sql-server-samples#276 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 35/100
microsoft/sql-server-samples#1497 ·
microsoft/sql-server-samples の issue をすべて見る
似ている issue
-
area/sessions comp/agent P2 tool/skills type/perf
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NousResearch/hermes-agent#117788 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
code-quality refactoring
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
github/gh-aw-firewall#8816 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
getgrav/grav-plugin-api#45 ·