‘Unexpected token < in JSON at position 0' echoed after posting
-
Hello Zaus and everybody,
I’m integrating with an auto-responder service, and my goal is to catch the response,
extract the success url, and redirect to it.Integration works OK (thanks for the great plugin by the way), so now I simply need
to catch the response, grab (somehow) the url which is in the ‘Location’ parameter of
the response header and redirect user to it: (‘Location” just below the red frame):
For that purpose, I created a custom action using the 3rd-party folder to aid me in creating the code (mailchimp code – thanks for this too, was very helpful to a noob like me!), and after saving my functions.php went ahead and made a submission.
What happened?
The submissions was once again successfully delivered to the 3-rd party, and in addition, I’m getting ‘Unexpected token < in JSON at position 0’ just beneath my form a few secs after clicking ‘Submit’:
THe post arrives at the 3rd party OK and the action fails.According to this:
https://stackoverflow.com/questions/37280274/syntaxerror-unexpected-token-in-json-at-position-0-in-react-appit seems that server is returning Content-Type: text/html while plugin is expecting JSON.
Could that be correct?
Am I missing something?
How can I make theis awesome plugin receive non JSON response and extract the Location param value from the header?Thanks a lot, your help much appreciated
Yosi
- The topic ‘‘Unexpected token < in JSON at position 0' echoed after posting’ is closed to new replies.