-
public interface HttpRequestInfoBuilderFor internal usage only.
A builder interface for modifying com.datadog.android.api.instrumentation.network.HttpRequestInfo instances. This interface allows to build new com.datadog.android.api.instrumentation.network.HttpRequestInfo with modified HTTP request properties such as URL, headers, and tags.
Use com.datadog.android.api.instrumentation.network.MutableHttpRequestInfo.newBuilder to obtain a builder instance.
-
-
Method Summary
Modifier and Type Method Description abstract HttpRequestInfoBuildersetUrl(String url)Sets the URL for this request. abstract HttpRequestInfoBuilderaddHeader(String key, String values)Adds a header with the specified key and values. abstract HttpRequestInfoBuilderremoveHeader(String key)Removes a header with the specified key. HttpRequestInfoBuilderreplaceHeader(String key, String value)Replaces a header with the specified key and value. abstract <T extends Any> HttpRequestInfoBuilderaddTag(Class<in T> type, T tag)Adds a tag of the specified type to this request. abstract HttpRequestInfoBuildersetMethod(String method, HttpRequestBody body)Sets the HTTP method for this request. abstract HttpRequestInfobuild()Builds and returns the modified com.datadog.android.api.instrumentation.network.HttpRequestInfo. -
-
Method Detail
-
setUrl
abstract HttpRequestInfoBuilder setUrl(String url)
Sets the URL for this request.
- Parameters:
url- the new URL to set.
-
addHeader
abstract HttpRequestInfoBuilder addHeader(String key, String values)
Adds a header with the specified key and values. If a header with the same key already exists, the new values are appended.
- Parameters:
key- the header name.values- the header values.
-
removeHeader
abstract HttpRequestInfoBuilder removeHeader(String key)
Removes a header with the specified key.
- Parameters:
key- the header name to remove.
-
replaceHeader
HttpRequestInfoBuilder replaceHeader(String key, String value)
Replaces a header with the specified key and value. This is equivalent to removing the existing header and adding a new one.
- Parameters:
key- the header name.value- the new header value.
-
addTag
abstract <T extends Any> HttpRequestInfoBuilder addTag(Class<in T> type, T tag)
Adds a tag of the specified type to this request. Tags can be used to attach arbitrary metadata to requests for later retrieval.
- Parameters:
type- the class representing the tag type.tag- the tag value, or null to remove the tag.
-
setMethod
abstract HttpRequestInfoBuilder setMethod(String method, HttpRequestBody body)
Sets the HTTP method for this request.
- Parameters:
method- the HTTP method to set (e.g., "GET", "POST").body- the optional request body, typically used with POST, PUT, or PATCH methods.
-
build
abstract HttpRequestInfo build()
Builds and returns the modified com.datadog.android.api.instrumentation.network.HttpRequestInfo.
-
-
-
-