public class ApiRequest
extends java.lang.Object
Constructor and Description |
---|
ApiRequest()
Constructor.
|
ApiRequest(java.lang.String serviceName)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ApiRequest |
addHeader(java.lang.String header,
java.lang.String value)
Sets the header in the request.
|
java.util.Map<java.lang.String,java.lang.String> |
getHeaders()
Returns a map of all the headers included in this request.
|
HttpMethodName |
getHttpMethod() |
java.util.Map<java.lang.String,java.lang.String> |
getParameters()
Returns a map of all parameters in this request.
|
java.lang.String |
getPath()
Returns the path to the resource being requested.
|
ApiRequest |
withBody(byte[] body)
Sets the optional stream containing the payload data from the byte array
to include for this request.
|
ApiRequest |
withBody(java.io.InputStream body)
Sets the optional stream containing the payload data to include for this
request.
|
ApiRequest |
withBody(java.lang.String body)
Sets the optional stream containing the payload data from a string
content to include for this request.
|
ApiRequest |
withHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Sets all headers, clearing any existing ones.
|
ApiRequest |
withHttpMethod(HttpMethodName httpMethod)
Sets the HTTP method (GET, POST, etc) to use when sending this request.
|
ApiRequest |
withParameter(java.lang.String name,
java.lang.String value)
Set parameters with name and value.
|
ApiRequest |
withParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
Sets all parameters, clearing any existing values.
|
ApiRequest |
withPath(java.lang.String path)
Sets the path to the resource being requested.
|
public ApiRequest(java.lang.String serviceName)
serviceName
- The name of the service to which this request is being
sent.public ApiRequest()
public ApiRequest withHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
headers
- A map of all http headerspublic ApiRequest addHeader(java.lang.String header, java.lang.String value)
header
- the http header name.value
- the http header value.public java.util.Map<java.lang.String,java.lang.String> getHeaders()
public ApiRequest withPath(java.lang.String path)
path
- The path to the resource being requested.public java.lang.String getPath()
public ApiRequest withParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
parameters
- the http request parameters.public java.util.Map<java.lang.String,java.lang.String> getParameters()
public ApiRequest withParameter(java.lang.String name, java.lang.String value)
name
- the parameter name.value
- the parameter value.public ApiRequest withHttpMethod(HttpMethodName httpMethod)
httpMethod
- The HTTP method to use when sending this request.public HttpMethodName getHttpMethod()
HttpMethodName
public ApiRequest withBody(java.io.InputStream body)
body
- The optional stream containing the payload data to include
for this request.public ApiRequest withBody(byte[] body)
body
- The request body represented as a array of bytes.public ApiRequest withBody(java.lang.String body)
body
- the request body represented as a string.Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.