Closed hoanghiep closed 1 year ago
Can you provide more details about the request before it is executed? Place a break point as shown in the image and show the debugger values for the entire request object... (remember to hide any secret keys or tokens in your image). The Content-Length as shown in your data is indicating 21 bytes and I need to see exactly what the 21 bytes of content were. This will help me to debug this issue further.
Here is more debug information 1.
2.
3.
Gson
Very interesting. Gson is failing to serialize your image data. What version of Java are you running in your environment? I am running version 1.8.0_162 and I do not get that same issue.
Execute this statement System.getProperty("java.version");
and see what you get.
My java version is 1.8.0_251
If i use this test script (gson is initialized with default configuration) then i get right value.
Gson gson = new Gson();
List<EtsyListingVariationImage> variationImages = new ArrayList<>();
EtsyListingVariationImage elvi = new EtsyListingVariationImage();
elvi.setImageId(1l);
elvi.setPropertyId(2l);
elvi.setValueId(3l);
variationImages.add(elvi);
UrlEncodedContent content = new UrlEncodedContent(Collections.singletonMap("variation_images", gson.toJson(Objects.requireNonNull(variationImages))));
Version 2 of the API has been turned off. Now moving to Version 3.
v1.0.0012