java - Getting "400 Bad Request" when I post shipping status to Shopify -
i try send shipping status shopify get:
400 bad request error.
does have ideas?
resttemplate resttemplate = new resttemplate(); resttemplate.getmessageconverters().add(new mappingjackson2httpmessageconverter()); resttemplate.getmessageconverters().add(new stringhttpmessageconverter()); httpheaders headers = new httpheaders(); headers.add("x-shopify-access-token", "9a4d5c56a7edf1ac5bb17aa1c"); headers.add("content-type", mediatype.application_json.tostring()); headers.add("accept", mediatype.application_json.tostring()); httpentity formentity = new httpentity(headers); resttemplate.setrequestfactory(new httpcomponentsclienthttprequestfactory()); resttemplate.getmessageconverters().add(new mappingjackson2httpmessageconverter()); responseentity<string> responseentity = resttemplate.exchange("https://mysite.myshopify.com/admin/orders/406287121/fulfillments.json",httpmethod.post, formentity,string.class); system.out.println("response="+responseentity.getbody());
Comments
Post a Comment