Ich habe Probleme beim Erstellen einer BC-Sendung für eine bestehende Bestellung.BigCommerce API Java Versand erstellen Fehler 400
Ich bin mit Standardauthentifizierung
JSON Anfrage ist { "order_address_id": 2, "Artikel": [{ "order_product_id": 164, "Menge": 1}, { "order_product_id": 124, "Quantität": 1}] "TRACKING_NUMMER": "abcd1234"}
Code ist wie folgt:
String storeurl="storeaddress"+"/orders/"+BCordernumber+"/shipments";
URL url = new URL(storeurl);
HttpURLConnection httpcon = (HttpURLConnection) url.openConnection();
httpcon.setRequestMethod("POST");
httpcon.setRequestProperty("Authorization", encodeBase64());
httpcon.setRequestProperty("Accept", "application/json");
httpcon.setDoOutput(true);
httpcon.setRequestProperty("Content-Type", "application/json");
OutputStreamWriter put = new OutputStreamWriter(httpcon.getOutputStream());
put.write(jsondata);
put.flush();
put.close();
int result = httpcon.getResponseCode();
Irgendwelche Ideen wäre toll, warum ich erhalte dieses 400-Fehler
Danke im Voraus
Sie müssen die Protokolle auf dem Server überprüfen, um die Stack-Trace und/oder andere Nachricht zu sehen. Ohne das wird es extrem schwierig zu debuggen. –