Package com.jsunsoft.http
Interface HttpRequest
-
public interface HttpRequest
HttpRequest is the main entry point to the API used to build and execute client requests.HttpRequest objects are immutable they can be shared.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WebTarget
immutableTarget(String uri)
Build a new immutable web resource target.WebTarget
immutableTarget(URI uri)
Build a new immutable web resource target.WebTarget
retryableTarget(String uri, RetryContext retryContext)
Build a new retryable web resource target.WebTarget
retryableTarget(URI uri, RetryContext retryContext)
Build a new retryable web resource target.WebTarget
target(String uri)
Build a new web resource target.WebTarget
target(URI uri)
Build a new web resource target.
-
-
-
Method Detail
-
target
WebTarget target(URI uri)
Build a new web resource target.- Parameters:
uri
- web resource URI. Must not benull
.- Returns:
- web resource target bound to the provided URI.
- Throws:
NullPointerException
- in case the supplied argument isnull
.
-
target
WebTarget target(String uri)
Build a new web resource target.- Parameters:
uri
- The string to be parsed into a URI- Returns:
- Target instance
- Throws:
NullPointerException
- Ifstr
isnull
IllegalArgumentException
- If the given string violates RFC 2396
-
retryableTarget
@Beta WebTarget retryableTarget(URI uri, RetryContext retryContext)
Build a new retryable web resource target.- Parameters:
uri
- web resource URI. Must not benull
.retryContext
- retryContext. Must not benull
.- Returns:
- Retryable WebTarget instance
- Throws:
NullPointerException
- in case the supplied argument isnull
.
-
retryableTarget
@Beta WebTarget retryableTarget(String uri, RetryContext retryContext)
Build a new retryable web resource target.- Parameters:
uri
- The string to be parsed into a URIretryContext
- retryContext. Must not benull
.- Returns:
- Retryable WebTarget instance
- Throws:
NullPointerException
- Ifstr
isnull
IllegalArgumentException
- If the given string violates RFC 2396
-
immutableTarget
WebTarget immutableTarget(URI uri)
Build a new immutable web resource target.- Parameters:
uri
- web resource URI. Must not benull
.- Returns:
- Immutable WebTarget instance. Can be shared between threads.
- Throws:
NullPointerException
- in case the supplied argument isnull
.
-
immutableTarget
WebTarget immutableTarget(String uri)
Build a new immutable web resource target.- Parameters:
uri
- The string to be parsed into a URI- Returns:
- Immutable WebTarget instance. Can be shared between threads.
- Throws:
NullPointerException
- Ifstr
isnull
IllegalArgumentException
- If the given string violates RFC 2396
-
-