Class 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 Detail

      • PostResource

        public PostResource​(java.lang.String uri)
      • PostResource

        public PostResource​(java.net.URI uri)
    • Method Detail

      • setEntity

        public void setEntity​(org.apache.http.HttpEntity entity)
      • setStringBody

        public void setStringBody​(java.lang.String body,
                                  org.apache.http.entity.ContentType contentType)