postForObject

open fun <T> postForObject(url: String, request: Any, responseType: Class<T>, urlVariables: Array<Any>): T

Create a new resource by POSTing the given object to the URI template, and returns the representation found in the response.

URI Template variables are expanded using the given URI variables, if any.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Return

the converted object

Parameters

url

the URL

request

the Object to be POSTed, may be null

responseType

the type of the return value

urlVariables

the variables to expand the template

<T>

the type of the return value

See also


open fun <T> postForObject(url: String, request: Any, responseType: Class<T>, urlVariables: Map<String, out Any>): T

Create a new resource by POSTing the given object to the URI template, and returns the representation found in the response.

URI Template variables are expanded using the given map.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Return

the converted object

Parameters

url

the URL

request

the Object to be POSTed, may be null

responseType

the type of the return value

urlVariables

the variables to expand the template

<T>

the type of the return value

See also


open fun <T> postForObject(url: URI, request: Any, responseType: Class<T>): T

Create a new resource by POSTing the given object to the URL, and returns the representation found in the response.

The request parameter can be a HttpEntity in order to add additional HTTP headers to the request.

Return

the converted object

Parameters

url

the URL

request

the Object to be POSTed, may be null

responseType

the type of the return value

<T>

the type of the return value

See also