To view the problem I encountered yesterday and has now been resolved, please visit Server API Cors Error.
The data I am sending should be in the form of an 'xlsx file' as expected by the server.
Although I am now able to receive the required Response headers, the Status Code has changed from 302 Authenticating to Status Code:415 Unsupported Media Type. Additionally, instead of returning an object like it should, the server is currently returning 'Error: [object Object] undefined'.
If you need to refer to the specific code mentioned above, please check out the link 'Server API Cors Error'.
Below are the responses intended to be returned when using the POST method. When making a Request Method - option call, I am receiving the expected status - 200 (ok).
Response headers:
Access-Control-Allow-Origin:*
Cache-Control:no-cache
Content-Length:0
Date:Thu, 07 Sep 2017 09:59:22 GMT
Expires:-1
Pragma:no-cache
Server:Microsoft-IIS/8.5
X-AspNet-Version:4.0.30319
X-Powered-By:ASP.NET
Requested header:
Accept:application/json, text/plain
Accept-Encoding:gzip, deflate
Accept-Language:en-US,en;q=0.8
file-token : xxxxxxxxxxxxxxxxx
Connection:keep-alive
Content-Length:44
Content-Type:application/json
Host: xxxxxxxxxxxxxxx
Origin: http:xxxxxxxxxxxxxxxx
Referer: http:xxxxxxxxxxxxxxxxxxxxxxxxxxxx
User-Agent:Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36
General Request:
URL: http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Request Method:POST
Status Code:415 Unsupported Media Type
Remote Address: xxxxxxxxxxxxxxxxxxxxxxxxxx
Referrer Policy:no-referrer-when-downgrade