Class TransportRequest
java.lang.Object
codes.grow.packages.skywalking.core.TransportRequest
One logical HTTP call executed by
HttpTransport (with retries). Immutable.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepts(int status) Returns whether a non-2xx status is returned to the caller instead of raising an error.Optional<byte[]> body()Returns a copy of the body.static TransportRequest.BuilderStarts a request.Returns the body content type.static TransportRequest.BuilderStarts a DELETE request.static TransportRequest.BuilderStarts a GET request.headers()Returns the request headers.booleanReturns whether the request may be replayed after an uncertain send.Returns the retry limit override.method()Returns the HTTP method.Returns the operation name used in error messages.path()Returns the path.static TransportRequest.BuilderStarts a POST request.static TransportRequest.BuilderStarts a PUT request.query()Returns the query parameters in insertion order.timeout()Returns the per-attempt timeout override.
-
Method Details
-
builder
Starts a request.- Parameters:
method- HTTP methodpath- path relative to the base URL (leading slash optional)- Returns:
- a new builder
-
get
Starts a GET request.- Parameters:
path- path relative to the base URL- Returns:
- a new builder
-
post
Starts a POST request.- Parameters:
path- path relative to the base URL- Returns:
- a new builder
-
put
Starts a PUT request.- Parameters:
path- path relative to the base URL- Returns:
- a new builder
-
delete
Starts a DELETE request.- Parameters:
path- path relative to the base URL- Returns:
- a new builder
-
method
Returns the HTTP method.- Returns:
- upper-case method
-
path
Returns the path.- Returns:
- the path
-
query
Returns the query parameters in insertion order.- Returns:
- immutable map
-
headers
Returns the request headers.- Returns:
- immutable map
-
body
Returns a copy of the body.- Returns:
- the body, or empty
-
contentType
Returns the body content type.- Returns:
- the content type, or empty
-
idempotent
public boolean idempotent()Returns whether the request may be replayed after an uncertain send.- Returns:
- explicit flag, or true for GET, HEAD, OPTIONS, PUT and DELETE
-
operation
Returns the operation name used in error messages.- Returns:
- e.g.
kv.read secret/app, or<METHOD> <path>
-
accepts
public boolean accepts(int status) Returns whether a non-2xx status is returned to the caller instead of raising an error.- Parameters:
status- HTTP status- Returns:
- true when accepted
-
maxRetries
Returns the retry limit override.- Returns:
- retries, or empty for the policy default
-
timeout
Returns the per-attempt timeout override.- Returns:
- timeout, or empty for the config default
-