/** * Perform a <code>POST</code> request with a content type of <code>application/x-www-form-urlencoded</code> * against the specified URL. * * @param url * The URL of the remote REST resource. * Can be any of the following: {@link String}, {@link URI}, {@link URL}. * @param o * The object to serialize and transmit to the URL as the body of the request, serialized as a form post * using the {@link UrlEncodingSerializer#DEFAULT} serializer. * @return * A {@link RestCall} object that can be further tailored before executing the request and getting the response * as a parsed object. * @throws RestCallException If any authentication errors occurred. */ public RestCall doFormPost(Object url, Object o) throws RestCallException { return doCall("POST", url, true) .body(o instanceof HttpEntity ? o : new RestRequestEntity(o, urlEncodingSerializer, null)); }
/** * Perform a <code>POST</code> request with a content type of <code>application/x-www-form-urlencoded</code> * against the specified URL. * * @param url * The URL of the remote REST resource. * Can be any of the following: {@link String}, {@link URI}, {@link URL}. * @param o * The object to serialize and transmit to the URL as the body of the request, serialized as a form post * using the {@link UrlEncodingSerializer#DEFAULT} serializer. * @return * A {@link RestCall} object that can be further tailored before executing the request and getting the response * as a parsed object. * @throws RestCallException If any authentication errors occurred. */ public RestCall doFormPost(Object url, Object o) throws RestCallException { return doCall("POST", url, true) .body(o instanceof HttpEntity ? o : new RestRequestEntity(o, urlEncodingSerializer, null)); }
/** * Perform a <code>POST</code> request with a content type of <code>application/x-www-form-urlencoded</code> * against the specified URL. * * @param url * The URL of the remote REST resource. * Can be any of the following: {@link String}, {@link URI}, {@link URL}. * @param o * The object to serialize and transmit to the URL as the body of the request, serialized as a form post * using the {@link UrlEncodingSerializer#DEFAULT} serializer. * @return * A {@link RestCall} object that can be further tailored before executing the request and getting the response * as a parsed object. * @throws RestCallException If any authentication errors occurred. */ public RestCall doFormPost(Object url, Object o) throws RestCallException { return doCall("POST", url, true) .body(o instanceof HttpEntity ? o : new RestRequestEntity(o, urlEncodingSerializer, null)); }
entity = new InputStreamEntity((InputStream)input, getRequestContentType(ContentType.APPLICATION_OCTET_STREAM)); else if (serializer != null) entity = new RestRequestEntity(input, serializer, requestBodySchema); else if (partSerializer != null) entity = new StringEntity(partSerializer.serialize((HttpPartSchema)null, input), getRequestContentType(TEXT_PLAIN));
entity = new InputStreamEntity((InputStream)input, getRequestContentType(ContentType.APPLICATION_OCTET_STREAM)); else if (serializer != null) entity = new RestRequestEntity(input, serializer, requestBodySchema); else if (partSerializer != null) entity = new StringEntity(partSerializer.serialize((HttpPartSchema)null, input), getRequestContentType(TEXT_PLAIN));
entity = new InputStreamEntity((InputStream)input, getRequestContentType(ContentType.APPLICATION_OCTET_STREAM)); else if (serializer != null) entity = new RestRequestEntity(input, serializer, requestBodySchema); else if (partSerializer != null) entity = new StringEntity(partSerializer.serialize((HttpPartSchema)null, input), getRequestContentType(TEXT_PLAIN));