Solved! Go to Solution.
@Vinux
This usually happens when you are sending cross domain request. But after OPTION, you might see post is also getting fired. In order to get through please try and set ACCESS-CONTROL-ALLOW in the header of response by setting * for all domain or your specific domain.
Also enable cors in your browser or by adding a policy.
Hope it helps. Let me know
Please provide the sample proxy and request - that help debug this faster.
Hi Sri,
PROBLEM :- We are sending a POST Request , but in the APG Trace , we can see that Instead of POST , OPTIONS Request is getting posted.
Because of which our UI is Breaking . We cross checked the UI and we are confident that Http Request is perfect.
Here in I am posting all the Required Data Needed for you to Investigate
Our JSON Request and POST Request
var custjson = '{"name":"raja","username":"raja","password":"tata","age":"24","zip":"453212","address":"Japan","email":"raja@gmail.com","customerId":"10877088"}'; $.ajax( { type: 'POST', contentType: 'application/json', url: 'http://vinux1-test.apigee.net/ecommercedata/customers?apikey=n4HdbfArygkGyJUUkSFCTmF1iwA4JtxI', data:custjson , dataType: 'json', beforeSend : function() { alert(" beforeSend Signup "); }, success: function(data){ alert("" + JSON.stringify(data)); if(localStorage.cartFlag =="cart") { window.location.href="checkout.html"; } else { window.location.href="allProducts.html"; } }, error: function(){ alert("error"); } });
Proxy URL and its response
http://vinux1-test.apigee.net/ecommercedata/customers?apikey=n4HdbfArygkGyJUUkSFCTmF1iwA4JtxI
Here in I am attaching the Screenshot
APG Trace for the respective JSON Proxy Request
Here in I am attaching the Screenshot showing the Issue
Thanks
Ranjay
@Vinux
This usually happens when you are sending cross domain request. But after OPTION, you might see post is also getting fired. In order to get through please try and set ACCESS-CONTROL-ALLOW in the header of response by setting * for all domain or your specific domain.
Also enable cors in your browser or by adding a policy.
Hope it helps. Let me know
Hi @Vinux Thomas , You may want to check this
You can use the proxy bundle attached there for reference .