Hi all,
i’ve some problem with java httpclient to consume shopify Rest Json Stream.
I’m building a request with this parameters ( userAgent is a chrome one) :
var resp = RequestBuilder.build()
.url("https://"+getAuthenticator().get("SUBDOMAIN")+".myshopify.com/admin/api/2022-01/"+entityName.toLowerCase()+".json")
.method(METHOD.GET)
.setClient(URLTools.newClient())
.addHeader("X-Shopify-Access-Token", getAuthenticator().get("ACCESS_TOKEN"))
.execute();
System.out.println("reading stream status=" + resp.getStatusLine() + " length=" + resp.getEntity().getContentLength());
String ret = EntityUtils.toString(resp.getEntity(), MTGConstants.DEFAULT_ENCODING);
System.out.println("RET="+ret);
System.out.println("End of function");
and here is my results :
reading stream status=HTTP/1.1 200 OK length=-1
//nothing printed
End of function
I don’t know why but it seems that InputStream is unreadable… any idea ?