Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTF-8 errors and inconsistency when trying to use POSTFIELDS #7

Closed
BrettRToomey opened this issue Aug 14, 2016 · 2 comments
Closed
Labels

Comments

@BrettRToomey
Copy link

BrettRToomey commented Aug 14, 2016

When trying to use the Stripe API with Swift and cURL I keep receiving complaints from the server along the lines of "Invalid UTF-8 characters found in POST body." On top of that, the behavior seems to be inconsistent and the request will occasionally be accepted by their server, but none of the post fields are used. I put up a repo to show the code I used and I'm wondering if I'm just using cURL/CCurl wrong or if this is a bug.

(this is a question, if someone could please add the label)

@shmuelk
Copy link
Contributor

shmuelk commented Aug 15, 2016

I looked at your test repository and noticed that you never set the Content-Type header in your request. I don't know what is the default Content-Type for POSTs in libCurl.

I also would recommend adding the following call:

curlHelperSetOptInt(handle, CURLOPT_VERBOSE, 1)

That call turns on all sorts of logging by libCurl. It may help. I don't remember if it adds logging of the body or not.

@kweinmeister
Copy link

Closing due to inactivity. If you are still seeing this issue on Swift 3.1, feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants