Package com.stripe.net
Class StripeRequest
- java.lang.Object
-
- com.stripe.net.StripeRequest
-
public final class StripeRequest extends java.lang.Object
A request to Stripe's API.
-
-
Constructor Summary
Constructors Modifier Constructor Description StripeRequest(ApiResource.RequestMethod method, java.lang.String url, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Initializes a new instance of theStripeRequest
class.protected
StripeRequest(ApiResource.RequestMethod method, java.net.URL url, HttpContent content, HttpHeaders headers, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpContent
content()
The body of the request.boolean
equals(java.lang.Object o)
int
hashCode()
HttpHeaders
headers()
The HTTP headers of the request (Authorization
,Stripe-Version
,Stripe-Account
,Idempotency-Key
...).ApiResource.RequestMethod
method()
The HTTP method for the request (GET, POST or DELETE).RequestOptions
options()
The special modifiers of the request.java.util.Map<java.lang.String,java.lang.Object>
params()
The parameters of the request (as an unmodifiable map).java.lang.String
toString()
java.net.URL
url()
The URL for the request.StripeRequest
withAdditionalHeader(java.lang.String name, java.lang.String value)
Returns a newStripeRequest
instance with an additional header.
-
-
-
Constructor Detail
-
StripeRequest
public StripeRequest(ApiResource.RequestMethod method, java.lang.String url, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Initializes a new instance of theStripeRequest
class.- Parameters:
method
- the HTTP methodurl
- the URL of the requestparams
- the parameters of the requestoptions
- the special modifiers of the request- Throws:
StripeException
- if the request cannot be initialized for any reason
-
StripeRequest
protected StripeRequest(ApiResource.RequestMethod method, java.net.URL url, HttpContent content, HttpHeaders headers, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
-
-
Method Detail
-
withAdditionalHeader
public StripeRequest withAdditionalHeader(java.lang.String name, java.lang.String value)
Returns a newStripeRequest
instance with an additional header.- Parameters:
name
- the additional header's namevalue
- the additional header's value- Returns:
- the new
StripeRequest
instance
-
method
public ApiResource.RequestMethod method()
The HTTP method for the request (GET, POST or DELETE).
-
url
public java.net.URL url()
The URL for the request. If this is a GET or DELETE request, the URL also includes the request parameters in its query string.
-
content
public HttpContent content()
The body of the request. For POST requests, this will be either aapplication/x-www-form-urlencoded
or amultipart/form-data
payload. For non-POST requests, this will benull
.
-
headers
public HttpHeaders headers()
The HTTP headers of the request (Authorization
,Stripe-Version
,Stripe-Account
,Idempotency-Key
...).
-
params
public java.util.Map<java.lang.String,java.lang.Object> params()
The parameters of the request (as an unmodifiable map).
-
options
public RequestOptions options()
The special modifiers of the request.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-