Package com.stripe.net
Class StripeRequest
java.lang.Object
com.stripe.net.StripeRequest
A request to Stripe's API.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStripeRequest(ApiResource.RequestMethod method, URL url, HttpContent content, HttpHeaders headers, Map<String, Object> params, RequestOptions options, ApiMode apiMode) -
Method Summary
Modifier and TypeMethodDescriptionapiMode()The version of the API (ApiMode.V1 or ApiMode.V2)content()The body of the request.static StripeRequestcreate(ApiResource.RequestMethod method, String url, Map<String, Object> params, RequestOptions options, ApiMode apiMode) Initializes a new instance of theStripeRequestclass.static StripeRequestcreateWithStringContent(ApiResource.RequestMethod method, String url, String content, RequestOptions options, ApiMode apiMode) Initializes a new instance of theStripeRequestclass.booleaninthashCode()headers()The HTTP headers of the request (Authorization,Stripe-Version,Stripe-Account,Idempotency-Key...).method()The HTTP method for the request (GET, POST or DELETE).options()The special modifiers of the request.params()The parameters of the request (as an unmodifiable map).toString()url()The URL for the request.withAdditionalHeader(String name, String value) Returns a newStripeRequestinstance with an additional header.
-
Constructor Details
-
StripeRequest
protected StripeRequest(ApiResource.RequestMethod method, URL url, HttpContent content, HttpHeaders headers, Map<String, Object> params, RequestOptions options, ApiMode apiMode)
-
-
Method Details
-
create
public static StripeRequest create(ApiResource.RequestMethod method, String url, Map<String, Object> params, RequestOptions options, ApiMode apiMode) throws StripeExceptionInitializes 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
-
createWithStringContent
public static StripeRequest createWithStringContent(ApiResource.RequestMethod method, String url, String content, RequestOptions options, ApiMode apiMode) throws StripeException Initializes a new instance of theStripeRequestclass.- Parameters:
method- the HTTP methodurl- the URL of the requestcontent- the body of the requestoptions- the special modifiers of the request- Throws:
StripeException- if the request cannot be initialized for any reason
-
withAdditionalHeader
Returns a newStripeRequestinstance with an additional header.- Parameters:
name- the additional header's namevalue- the additional header's value- Returns:
- the new
StripeRequestinstance
-
method
The HTTP method for the request (GET, POST or DELETE). -
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
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
The HTTP headers of the request (Authorization,Stripe-Version,Stripe-Account,Idempotency-Key...). -
params
The parameters of the request (as an unmodifiable map). -
options
The special modifiers of the request. -
apiMode
The version of the API (ApiMode.V1 or ApiMode.V2) -
equals
-
hashCode
public int hashCode() -
toString
-