microsoft/SimpleRestClients

rest header can not set

wangfaxi1985 opened this issue · 1 comments

My http interface is :

public _performApiCall(apiPath: string, action: HttpAction, objToPost: any, givenOptions: ApiCallOptions): SyncTasks.Promise<WebResponse> {
givenOptions = {
contentType:'application/json',
headers: {
'Client-Device-Id': '1213113131313',
'Authorization': Bearer ${UserManager.Instance.getUser().token}
}, ...givenOptions
};
return super._performApiCall(apiPath, action, objToPost, givenOptions);
}

find reason:
our server not suppert : access-control

can close it !!!!!

The request you've shown is the CORS preflight request (OPTIONS). This is a browser mechanism to see if the request is allowed. You should see the actual POST request fired shortly after a successful preflight request.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS