Package com.stripe.net
Class StripeRequest
- java.lang.Object
-
- com.stripe.net.StripeRequest
-
public final class StripeRequest extends java.lang.ObjectA 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 theStripeRequestclass.protectedStripeRequest(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 HttpContentcontent()The body of the request.booleanequals(java.lang.Object o)inthashCode()HttpHeadersheaders()The HTTP headers of the request (Authorization,Stripe-Version,Stripe-Account,Idempotency-Key...).ApiResource.RequestMethodmethod()The HTTP method for the request (GET, POST or DELETE).RequestOptionsoptions()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.StringtoString()java.net.URLurl()The URL for the request.StripeRequestwithAdditionalHeader(java.lang.String name, java.lang.String value)Returns a newStripeRequestinstance 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 theStripeRequestclass.- 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 newStripeRequestinstance with an additional header.- Parameters:
name- the additional header's namevalue- the additional header's value- Returns:
- the new
StripeRequestinstance
-
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-urlencodedor amultipart/form-datapayload. 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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-