public class Headers extends Object
| Constructor and Description |
|---|
Headers() |
Headers(Collection<kong.unirest.Headers.Entry> entries) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(String name,
String value)
Add a header element
|
void |
add(String name,
Supplier<String> value)
Add a header element with a supplier which will be evaluated on request
|
List<Header> |
all()
Get all of the headers
|
void |
clear()
Clear the headers!
|
boolean |
containsKey(String name)
Check if a header is present
|
void |
cookie(Collection<Cookie> cookies) |
void |
cookie(Cookie cookie) |
boolean |
equals(Object o) |
List<String> |
get(String name)
Get all the values for a header name
|
String |
getFirst(String key)
Get the first header value for a name
|
int |
hashCode() |
void |
putAll(Headers header)
Add a bunch of headers at once
|
void |
replace(String name,
String value)
Replace a header value.
|
int |
size()
Get the number of header keys.
|
String |
toString() |
public Headers()
public Headers(Collection<kong.unirest.Headers.Entry> entries)
public void add(String name, String value)
name - the name of the headervalue - the value for the headerpublic void add(String name, Supplier<String> value)
name - the name of the headervalue - the value for the headerpublic void replace(String name, String value)
name - the name of the headervalue - the value for the headerpublic int size()
public List<String> get(String name)
name - name of the header elementpublic void putAll(Headers header)
header - a headerpublic boolean containsKey(String name)
name - a headerpublic void clear()
public String getFirst(String key)
key - the name of the headerpublic String toString()
public void cookie(Cookie cookie)
public void cookie(Collection<Cookie> cookies)
Copyright © 2020. All rights reserved.