@Ryan1 share the error messages. and why don’t you use python to get api responses ?
@Ryan1
I just tried your code and it works . so I am guessing the problem is the api authentication as your readystate indicates 4. are you sure about the url and the authentication in the header ? have you tried postman to test it ? try to remove the datatype . it was giving errors in my case .
@Ryan1 what is the authorization field you wrote in the header of the call ? because I can’t see it in postman .
Authorization is not needed actually, the site ‘http://localhost:5000’ (running in flask, not a part of erpnext) simply throws value 220 which I need to fetch in erpnext doc. @bahaou
then remove it , and remove the datatype , it’s not json in your case
@Ryan1 try to add this header
headers: { 'Access-Control-Allow-Origin': 'http://The web site allowed to access' },
@Ryan1 I really can’t do much more about this . just write python code and use js to call that python code. that would work better anyways .
@bahaou Cannot write python code as server side customization cannot be done for the client…anyways thanks
Tried earlier…not works! same CORS problem eventhough put it in common site config and site config. @revant_one