I
I
IB4952021-05-16 20:45:44
JavaScript
IB495, 2021-05-16 20:45:44

Problem with Access-Control-Allow?

When I get a json object from another server that I gave access to by including Access-Control-Allow-Headers, Access-Control-Allow-Methods and Access-Control-Allow-Origin, and when deserializing the json into a js object , I get a SyntaxError: Unexpected end of JSON input, since the server first responds with Access headers, calls the function to deserialize json, passes undefined there, and only then the request continues and I get a json object, successfully deserialize it in js, can someone know how to avoid an error?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question