Class StripeRequest


  • public final class StripeRequest
    extends java.lang.Object
    A request to Stripe's API.
    • 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 the StripeRequest class.
        Parameters:
        method - the HTTP method
        url - the URL of the request
        params - the parameters of the request
        options - the special modifiers of the request
        Throws:
        StripeException - if the request cannot be initialized for any reason
    • Method Detail

      • withAdditionalHeader

        public StripeRequest withAdditionalHeader​(java.lang.String name,
                                                  java.lang.String value)
        Returns a new StripeRequest instance with an additional header.
        Parameters:
        name - the additional header's name
        value - the additional header's value
        Returns:
        the new StripeRequest instance
      • 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 a application/x-www-form-urlencoded or a multipart/form-data payload. For non-POST requests, this will be null.
      • 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 class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object