Hello, I have been trying to get a POST request to work from Swagger-Editor, but the OPTIONS preflight request continuously is denied. I have enabled CORS on my server, but every time I have attempted to run a POST method from the swagger editor (installed using git clone, nmp install, npm start), the preflight OPTIONS request returns a 405 Method Not Allowed error. I have tried changing the response headers multiple times, and found the only thing that worked was to use Fiddler to change the preflight request from an OPTIONS request to a POST request, which is not a viable solution since the OPTIONS request is sent every time, and I need that request to be accepted. I have not been able to figure out a way to get the OPTIONS preflight request to return an OK HTTP status code. I've been working on the IIS 8.5 manager, but have yet to find a way to accept the OPTIONS request. The request I am getting is:
OPTIONS /SearchSvc/CVWebService.svc/Login HTTP/1.1 Host: localhost:81 Connection: keep-alive Access-Control-Request-Method: POST Origin: http://localhost:3001 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36 Access-Control-Request-Headers: content-type Accept: */* Referer: http://localhost:3001/ Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.8 and the response is: HTTP/1.1 405 Method Not Allowed Allow: POST Content-Length: 1754 Content-Type: text/html; charset=UTF-8 Server: Microsoft-IIS/8.5 X-Powered-By: ASP.NET Access-Control-Allow-Methods: POST, GET, PUT, DELETE, OPTIONS Access-Control-Allow-Headers: Authorization, Content-Type, Accept, X-Rquested-With, Origin, Access-Control-Request-Header, Access-Control-Request-Method, Accept-Encoding, Accept-Language, Cache-Control Access-Control-Allow-Origin: * Date: Mon, 07 Aug 2017 15:35:07 GMT Can anyone help? Thanks. -- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
