This is the URL
curl -H "Authorization: Bearer oVi4yPxk1bJ64Y2qOsLJ2D2ZlC3FpK4L" https://api.url.com/v1/market/total-items.json
I want to use it on JAVA where oVi4yPxk1bJ64Y2qOsLJ2D2ZlC3FpK4L value will be a dynamic value which i receive using a variable.
This is how you do it in Java. curl - h is taken care by httpPost.addHeader() curl - d by the form body curl -u at least in the case of this API (e.g stripe) it was the authorization Bearer. In case of Oauth2, curl -u is passing username:password in the header e.g