I'm using this library in React js. Right now I'm facing cors error for the particular URL.
It might be possible that cors are not set from the server side but I want to pass response headers to see if it works or not.
Sorry but this does not appear to be an issue with Ky. We would be happy answer your general help questions over on Stack Overflow. Could you please post this question there?
The short answer is that you need to send a CORS request with Ky and then the server needs to respond with the appropriate headers. Ky does not control the response headers because it is not a server. If you simply want to see what the response headers are, then you should use your browser's Network tab in the developer tools to inspect the request and response.
Sending CORS requests with Ky is identical to how it is done with fetch. I strongly suggest reading MDN's article on CORS as it may give you some insight into what is wrong.
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
If you need further assistance, please post on Stack Overflow with a code sample and the details of the headers from the Network tab.
Most helpful comment
Sorry but this does not appear to be an issue with Ky. We would be happy answer your general help questions over on Stack Overflow. Could you please post this question there?
The short answer is that you need to send a CORS request with Ky and then the server needs to respond with the appropriate headers. Ky does not control the response headers because it is not a server. If you simply want to see what the response headers are, then you should use your browser's Network tab in the developer tools to inspect the request and response.
Sending CORS requests with Ky is identical to how it is done with
fetch. I strongly suggest reading MDN's article on CORS as it may give you some insight into what is wrong.https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
If you need further assistance, please post on Stack Overflow with a code sample and the details of the headers from the Network tab.