public class HttpBody extends Object
Create an instance using one of the form(java.util.Map<java.lang.String, ?>)
or json(byte[])
static factory methods, depending on the desired content type.
Modifier and Type | Method and Description |
---|---|
static HttpBody |
form(List<NameValuePair> data)
Creates an HTTP body with content type "application/x-www-form-urlencoded" and the given form data.
|
static HttpBody |
form(Map<String,?> data)
Creates an HTTP body with content type "application/x-www-form-urlencoded" and the given form data.
|
static HttpBody |
form(NameValuePair... data)
Creates an HTTP body with content type "application/x-www-form-urlencoded" and the given form data.
|
static HttpBody |
form(NameValuePairs data)
Creates an HTTP body with content type "application/x-www-form-urlencoded" and the given form data.
|
static HttpBody |
json(byte[] json)
Creates an HTTP body with content type "application/json" and the given content.
|
static HttpBody |
json(String json)
Creates an HTTP body with content type "application/json" and the given content.
|
public static HttpBody json(byte[] json)
public static HttpBody json(String json)
public static HttpBody form(Map<String,?> data)
This method URL-encodes the names and values; make sure the names and values you pass in are *NOT* already URL-encoded.
public static HttpBody form(List<NameValuePair> data)
This method URL-encodes the names and values; make sure the names and values you pass in are *NOT* already URL-encoded.
public static HttpBody form(NameValuePair... data)
This method URL-encodes the names and values; make sure the names and values you pass in are *NOT* already URL-encoded.
public static HttpBody form(NameValuePairs data)
This method URL-encodes the names and values; make sure the names and values you pass in are *NOT* already URL-encoded.
Copyright © 2024 Couchbase, Inc.. All rights reserved.