0
調用POST請求在角2角2觀測量POST頭
let currentUser = JSON.parse(localStorage.getItem('currentUser'));
let headers = new Headers();
headers.append('Authorization', 'Bearer ' + currentUser.token);
this.http.post(environment.API_ENDPOINT + 'user/register?name=' + name + '&email=' + email + '&os_version=' + os_version
+ '&os=' + os + '&device_id=' + device_id,
{ headers }).map((response: Response) => response.json());
問題是標頭不由Python /龍捲風識別Server.When我調試的報頭和其它信息有「 \ N」。
登錄
<URL>/user/register?name=cool2&[email protected]&password=qwerty1233456&os_version=xyz&os=xyz&device_id=xyz,
body: b'{\n "method": null,\n
"headers": {\n "Authorization": [\n "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiNTc0Y2UzMzI4YjEyZDgyMWEwMmFkMDllIiwiZXhwIjoxNDkyNTc1NzA3fQ.VkHHr15GQWkZqBllX5I3DUuaEPYOmFYOx92qKZfw8Vs"\n ]\n },
\n "body": null,\n "url": null,\n "withCredentials": null,\n "responseType": null\n}'
你檢查了答案嗎?如果其中一些有幫助,您可以將其標記爲已接受,否則請寫下評論,說明爲什麼它沒有幫助。 –