Package com.veeva.vault.sdk.api.http
Interface FormHttpRequest.Builder
- All Superinterfaces:
HttpWebRequest.Builder<FormHttpRequest.Builder>
- Enclosing interface:
- FormHttpRequest
public static interface FormHttpRequest.Builder
extends HttpWebRequest.Builder<FormHttpRequest.Builder>
Builds a
FormHttpRequest
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Retrieves the completedFormHttpRequest
.Specifies request body as CSV as returned byCsvData.asString()
.Specifies request body as JSON as returned byJsonArray.asString()
.withBody
(JsonObject body) Specifies request body as JSON as returned byJsonObject.asString()
.Specifies request body as a string.<U extends UserDefinedModel>
FormHttpRequest.BuilderwithBody
(Collection<U> body) Specifies request body as the serialized form of the providedUserDefinedModel
s.<U extends UserDefinedModel>
FormHttpRequest.BuilderwithBody
(U body) Specifies request body as the serialized form of the providedUserDefinedModel
.withBodyParam
(String name, String value) Specifies a body parameter.withContentType
(HttpRequestContentType contentType) Specifies theContent-Type
header for this HTTP request.Methods inherited from interface com.veeva.vault.sdk.api.http.HttpWebRequest.Builder
withConnectionName, withHeader, withLocalConnection, withMethod, withPath, withQuerystringParam, withResolveTokens, withTimeout, withTokenRequest
-
Method Details
-
withBodyParam
Specifies a body parameter. Header defaults toContent-Type: application/x-www-form-urlencoded; charset=utf-8
. If header is set toContent-Type: text/plain; charset=utf-8
, body param name-value pairs will be encoded. Otherwise, if body encoding is not expected, usewithBody(String)
.- Parameters:
name
- body param name. Cannot be null or empty.value
- body param value. Cannot be null.- Returns:
- this Builder
-
withBody
Specifies request body as a string. Header defaults toContent-Type: application/x-www-form-urlencoded; charset=utf-8
.- Parameters:
body
- request body. Cannot be null.- Returns:
- this Builder
-
withBody
Specifies request body as CSV as returned byCsvData.asString()
. Header defaults toContent-Type: text/csv; charset=utf-8
.- Parameters:
body
- request body. Cannot be null.- Returns:
- this Builder
-
withBody
Specifies request body as JSON as returned byJsonObject.asString()
. Header defaults toContent-Type: application/json; charset=utf-8
.- Parameters:
body
- request body. Cannot be null.- Returns:
- this Builder
-
withBody
Specifies request body as JSON as returned byJsonArray.asString()
. Header defaults toContent-Type: application/json; charset=utf-8
.- Parameters:
body
- request body. Cannot be null.- Returns:
- this Builder
-
withBody
Specifies request body as the serialized form of the providedUserDefinedModel
. To specify a specific content type to serialize the body to, set the Content-Type header (seewithContentType(HttpRequestContentType)
).Note: This method will fail if the Content-Type header has been set to a value that is not supported by
Header defaults toUserDefinedModel
.Content-Type: application/json; charset=utf-8
.- Type Parameters:
U
- type of UserDefinedModel- Parameters:
body
- request body. Cannot be null.- Returns:
- this Builder
-
withBody
Specifies request body as the serialized form of the providedUserDefinedModel
s. To specify a specific content type to serialize the body to, set the Content-Type header (seewithContentType(HttpRequestContentType)
).Note: This method will fail if the Content-Type header has been set to a value that is not supported by
Header defaults toUserDefinedModel
.Content-Type: application/json; charset=utf-8
.- Type Parameters:
U
- type of UserDefinedModel- Parameters:
body
- request body. Cannot be null.- Returns:
- this Builder
-
withContentType
Specifies theContent-Type
header for this HTTP request. Calling this method is effectively the same as callingHttpWebRequest.Builder.withHeader(String, String)
and passing in "Content-Type" as the header, for example:withHeader("Content-Type","application/json")
- Parameters:
contentType
- the content type to serialize this request's body as. Cannot be null.- Returns:
- this Builder
-
build
FormHttpRequest build()Retrieves the completedFormHttpRequest
.- Returns:
- the completed FormHttpRequest
-