code: public static OutputStream put(HttpNode resource) throws IOException {
          Request put;
          HttpConnection connection;
  
          put = new Request("PUT", resource);
          put.addRequestHeader(Header.TRANSFER_ENCODING, HttpConnection.CHUNK_CODING);
          connection = put.open(null);
          return new ChunkedOutputStream(connection.getOutputStream()) {
              private boolean closed = false;
              @Override
              public void close() throws IOException {
                  Response reponse;
                  int code;
  
                  if (closed) {
                      return;
                  }
                  closed = true;
                  super.close();
                  reponse = put.finish(connection);
                  code = reponse.getStatusLine().code;
                  if (code != StatusCode.OK && code != StatusCode.NO_CONTENT && code != StatusCode.CREATED) {
                      throw StatusException.forResponse(resource, reponse);
                  }
              }
          };
      }
docs: See https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#PUT