-
public abstract class AbstractHttpEntity
-
-
Field Summary
Fields Modifier and Type Field Description private Stringbodyprivate longbodyLength
-
Method Summary
Modifier and Type Method Description StringgetBody()Return the captured HTTP body if one has been set, or null. voidsetBody(@Nullable() String body)Set or clear the captured body. longgetBodyLength()Return the body length (as set with setBodyLength) or -1 if none has been set. voidsetBodyLength(long bodyLength)Change the reported size of the request body size (in bytes). voidaddHeader(@NonNull() String name, @NonNull() String value)Add a header to this reported HTTP entity. voidremoveHeader(@NonNull() String name)Remove the specified header by name (case-sensitive). Set<String>getHeaderNames()Return the headers that are set for this HTTP entity. StringgetHeader(@NonNull() String headerName)Return the HTTP header by name or an empty string if the header is not present. -
-
Method Detail
-
setBody
void setBody(@Nullable() String body)
Set or clear the captured body.
- Parameters:
body- the body to report
-
getBodyLength
long getBodyLength()
Return the body length (as set with setBodyLength) or -1 if none has been set.
-
setBodyLength
void setBodyLength(long bodyLength)
Change the reported size of the request body size (in bytes).
- Parameters:
bodyLength- the number of bytes in the request body
-
addHeader
void addHeader(@NonNull() String name, @NonNull() String value)
Add a header to this reported HTTP entity.
- Parameters:
name- the name of the headervalue- the value of the header
-
removeHeader
void removeHeader(@NonNull() String name)
Remove the specified header by name (case-sensitive).
- Parameters:
name- the header to remove
-
getHeaderNames
@NonNull() Set<String> getHeaderNames()
Return the headers that are set for this HTTP entity.
-
-
-
-