java - CURL command in HTTPClient code -
i'm planning on working text uploading site, http://textuploader.com/, don't seem understand this. haven't looked hard enough, that's not point. i'm looking how these commands, or how use "httpclient" these sorts of things. site of commands , information here. also, convenience, should leave important ones me, in post:
post: /posts allow post account. { "title": "sample title", "content": "post body goes here.", "type": "public" } example: curl -x post "http://api.textuploader.com/v1/posts" \ -h "accept: application/json" \ -h "content-type: application/json" \ -h "x-textuploader-api-key: your-api-key-here" \ -v \ -d '{"title": "sample title", "content": "post body goes here.", "type": "public"}' , this: get: /posts/[shortcode] method return complete body of requested shortcode.
nicolas filotto's answer on here perfect: how make post curl request in java
here if rather stay on page:
if use davidwebb lightweight java http-client calling json rest-services , proceed next:
webb webb = webb.create(); jsonobject result = webb .post("https://api.gupshup.io/appsdk/api/components/adduser") .header("content-type", "application/x-www-form-urlencoded") .header("apikey", "xxxx") .body("name=abcd&email=test@test.com.com&id=abc") .asjsonobject() .getbody();
Comments
Post a Comment