Package com.couchbase.client.java.http
Class HttpBody
- java.lang.Object
-
- com.couchbase.client.java.http.HttpBody
-
public class HttpBody extends Object
The body of a POST or PUT request.Create an instance using one of the
form(java.util.Map<java.lang.String, ?>)orjson(byte[])static factory methods, depending on the desired content type.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static HttpBodyform(NameValuePair... data)Creates an HTTP body with content type "application/x-www-form-urlencoded" and the given form data.static HttpBodyform(NameValuePairs data)Creates an HTTP body with content type "application/x-www-form-urlencoded" and the given form data.static HttpBodyform(List<NameValuePair> data)Creates an HTTP body with content type "application/x-www-form-urlencoded" and the given form data.static HttpBodyform(Map<String,?> data)Creates an HTTP body with content type "application/x-www-form-urlencoded" and the given form data.static HttpBodyjson(byte[] json)Creates an HTTP body with content type "application/json" and the given content.static HttpBodyjson(String json)Creates an HTTP body with content type "application/json" and the given content.
-
-
-
Method Detail
-
json
public static HttpBody json(byte[] json)
Creates an HTTP body with content type "application/json" and the given content.
-
json
public static HttpBody json(String json)
Creates an HTTP body with content type "application/json" and the given content.
-
form
public static HttpBody form(Map<String,?> data)
Creates an HTTP body with content type "application/x-www-form-urlencoded" and the given form data.This method URL-encodes the names and values; make sure the names and values you pass in are *NOT* already URL-encoded.
-
form
public static HttpBody form(List<NameValuePair> data)
Creates an HTTP body with content type "application/x-www-form-urlencoded" and the given form data.This method URL-encodes the names and values; make sure the names and values you pass in are *NOT* already URL-encoded.
-
form
public static HttpBody form(NameValuePair... data)
Creates an HTTP body with content type "application/x-www-form-urlencoded" and the given form data.This method URL-encodes the names and values; make sure the names and values you pass in are *NOT* already URL-encoded.
-
form
public static HttpBody form(NameValuePairs data)
Creates an HTTP body with content type "application/x-www-form-urlencoded" and the given form data.This method URL-encodes the names and values; make sure the names and values you pass in are *NOT* already URL-encoded.
-
-