in reply to Re: HTTP::Tiny losing headers for Stripe
in thread HTTP::Tiny losing headers for Stripe
I imagine it needs to be encoded as JSON
No - Stripe takes key/value pairs.
To quote the documentation:
accepts form-encoded request bodies, returns JSON-encoded responses
For a form-encoded request, application/x-www-form-urlencoded is required hence the use of post_form().
The syntax of the call to Stripe works elsewhere in my code. Indeed, the call I am making works provided I don't make another call before it - it is this problem I want help resolving.
I'm unsure if it is an issue with HTTP::Tiny not being able to reuse the header information or an issue with Stripe or something else...
Out of interest, I have tried using the request() method as you suggested.
With the first call still in the code I continue to get a 401 error and the message that I have not supplied an API Key.
If I comment out the first call to Stripe, it accepts the API Key but returns the entire subscription object because it is not accepting the JSON encoded payload.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: HTTP::Tiny losing headers for Stripe
by tangent (Parson) on Jun 26, 2022 at 00:23 UTC | |
by Bod (Parson) on Jun 26, 2022 at 09:45 UTC |