Package org.maproulette.client.http
Class PostResource
- java.lang.Object
-
- org.maproulette.client.http.HttpResource
-
- org.maproulette.client.http.PostResource
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
PutResource
public class PostResource extends HttpResource
Usage: byte[] body = "{\"test\":\"test\"}".getBytes(); URI uri = new URIBuilder("http://localhost:2020/path/to/location").build(); HttpResource post = new PostResource(uri, body); //read the response post.lines().foreach(System.out.println(x)); // get the status code int code = post.getStatusCode();
-
-
Constructor Summary
Constructors Constructor Description PostResource(java.lang.String uri)PostResource(java.net.URI uri)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsetEntity(org.apache.http.HttpEntity entity)voidsetStringBody(java.lang.String body, org.apache.http.entity.ContentType contentType)-
Methods inherited from class org.maproulette.client.http.HttpResource
close, execute, getHeader, getRequest, getResponse, getResponseBodyAsString, getStatusCode, getUri, setAuth, setHeader, setProxy, setRequest
-
-