Package software.amazon.awssdk.crt.http
Class HttpRequest
- java.lang.Object
-
- software.amazon.awssdk.crt.http.HttpRequest
-
public class HttpRequest extends Object
Represents a single Client Request to be sent on a HTTP connection
-
-
Constructor Summary
Constructors Constructor Description HttpRequest(String method, String encodedPath)HttpRequest(String method, String encodedPath, HttpHeader[] headers, HttpRequestBodyStream bodyStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHeader(String headerName, String headerValue)voidaddHeader(HttpHeader header)voidaddHeaders(HttpHeader[] headers)HttpRequestBodyStreamgetBodyStream()StringgetEncodedPath()List<HttpHeader>getHeaders()HttpHeader[]getHeadersAsArray()StringgetMethod()byte[]marshalForJni()Requests are marshalled as follows: each string field is: [4-bytes BE] [variable length bytes specified by the previous field] Each request is then: [method][path][header name-value pairs]voidsetEncodedPath(String encodedPath)
-
-
-
Constructor Detail
-
HttpRequest
public HttpRequest(String method, String encodedPath)
- Parameters:
method- http verb to useencodedPath- path of the http request
-
HttpRequest
public HttpRequest(String method, String encodedPath, HttpHeader[] headers, HttpRequestBodyStream bodyStream)
- Parameters:
method- http verb to useencodedPath- path of the http requestheaders- set of http request headers to includebodyStream- (optional) interface to an object that will stream out the request body
-
-
Method Detail
-
getMethod
public String getMethod()
-
getEncodedPath
public String getEncodedPath()
-
setEncodedPath
public void setEncodedPath(String encodedPath)
-
getHeaders
public List<HttpHeader> getHeaders()
-
getHeadersAsArray
public HttpHeader[] getHeadersAsArray()
-
addHeader
public void addHeader(HttpHeader header)
-
addHeaders
public void addHeaders(HttpHeader[] headers)
-
getBodyStream
public HttpRequestBodyStream getBodyStream()
-
marshalForJni
public byte[] marshalForJni()
Requests are marshalled as follows: each string field is: [4-bytes BE] [variable length bytes specified by the previous field] Each request is then: [method][path][header name-value pairs]- Returns:
- encoded blob of headers
-
-