1

I am trying to do HTTPS POST using curl api in C. I am posting binary data by converting it into base64. However the base64 converted data is getting modified by the curl library. The + symbols in the parameter are getting replaced with spaces. I tried setting the charset as utf-8 and the content type as json. That did not help. Is there a reason why this could be happening? I am on macOS.

Is there a way/option to tell curl to not touch/change my data?

SFlow
  • 283
  • 3
  • 9
  • [May this can help](https://unix.stackexchange.com/questions/86729/any-way-to-encode-the-url-in-curl-command) – Gaurav Pathak Apr 21 '17 at 21:35
  • 1
    At a guess, somehow you sent your data through a URL encoding routine. A space can be URL-ecoded either as a `+` or a `%20`, so that a good chance where the pluses came from. https://www.w3schools.com/tags/ref_urlencode.asp *URLs cannot contain spaces. URL encoding normally replaces a space with a plus (+) sign or with %20* – infixed Apr 21 '17 at 21:40
  • I am not URL encoding the data. I base64 encode it using something like this (https://www.base64decode.org) – SFlow Apr 21 '17 at 21:45
  • Show your code... – TonyB Apr 22 '17 at 02:07
  • Look at this post: https://stackoverflow.com/questions/7410515/post-value-geting-plus-signs-removed – Ángel Ramírez Isea May 24 '23 at 17:26

0 Answers0