Package org.mozilla.geckoview
Class WebMessage.Builder
Object
org.mozilla.geckoview.WebMessage.Builder
- Direct Known Subclasses:
WebRequest.Builder
,WebResponse.Builder
- Enclosing class:
- WebMessage
This is a Builder used by subclasses of
WebMessage
.-
Method Summary
Modifier and TypeMethodDescriptionAdd a HTTP header.Set a HTTP header.Set the URI
-
Method Details
-
uri
Set the URI- Parameters:
uri
- A URI String- Returns:
- This Builder instance.
-
header
Set a HTTP header. This may be called multiple times for additional headers. If an existing header of the same name exists, it will be replaced by this value.Please note that the HTTP header keys are case-insensitive. It means you can retrieve "Content-Type" with map.get("content-type"), and value for "Content-Type" will be overwritten by map.put("cONTENt-TYpe", value); The keys are also sorted in natural order.
- Parameters:
key
- The key for the HTTP header, e.g. "content-type".value
- The value for the HTTP header, e.g. "application/json".- Returns:
- This Builder instance.
-
addHeader
Add a HTTP header. This may be called multiple times for additional headers. If an existing header of the same name exists, the values will be merged.Please note that the HTTP header keys are case-insensitive. It means you can retrieve "Content-Type" with map.get("content-type"), and value for "Content-Type" will be overwritten by map.put("cONTENt-TYpe", value); The keys are also sorted in natural order.
- Parameters:
key
- The key for the HTTP header, e.g. "content-type".value
- The value for the HTTP header, e.g. "application/json".- Returns:
- This Builder instance.
-