We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hi, trying to do the equivalent of curl http://URL -d '{JSON}'
cant find a way to do it. seems like all the requests here work on a key=value basis and there is no way to just send the Json in the payload.
currently doing it with Apaches HttpClient as below but would love to simplify my code using your package:
HttpPost request = new HttpPost(url); String s = cmd.toString(); StringEntity params = new StringEntity(s); request.addHeader(CONTENT_TYPE, APPLICATION_JSON); request.setEntity(params); httpClient.execute(request);
The text was updated successfully, but these errors were encountered:
You can use the send method to send an arbitrary String in the request body. e.g.
send
String json = "{JSON}"; HttpRequest request = new HttpRequest("http://URL", "POST"); request.send(json); String responseBody = request.body(); int code = request.code();
Sorry, something went wrong.
aha... must've missed that option. thanks dude.
Sent from my Hot Pink Asus Zenbook
On Sun, Jan 20, 2013 at 9:02 PM, Marc Zych notifications@github.com wrote:
You can use the send method to send an arbitrary String in the request body. e.g. String json = "{JSON}";HttpRequest request = new HttpRequest("http://URL", "POST");request.send(json); String responseBody = request.body();int code = request.code(); — Reply to this email directly or view it on GitHubhttps://github.com//issues/14#issuecomment-12475375.
String json = "{JSON}";HttpRequest request = new HttpRequest("http://URL", "POST");request.send(json); String responseBody = request.body();int code = request.code();
— Reply to this email directly or view it on GitHubhttps://github.com//issues/14#issuecomment-12475375.
@marczych thanks for pointing that out.
@orrgal1 I'm going to close this issue but please feel free to reopen if you have any issues with the API recommended.
No branches or pull requests
hi,
trying to do the equivalent of
curl http://URL -d '{JSON}'
cant find a way to do it. seems like all the requests here work on a key=value basis and there is no way to just send the Json in the payload.
currently doing it with Apaches HttpClient as below but would love to simplify my code using your package:
The text was updated successfully, but these errors were encountered: