cURL / Mailing Lists / curl-users / Single Mail

curl-users

HTTP PATCH does (not??) send JSON data to API

From: Petr Lázňovský <lazna_at_volny.cz>
Date: Tue, 2 Jun 2015 14:25:24 +0200

Trying to use curl.exe with PATCH method to send JSON data to API, by pushing data to STDIN of curl (avoid to write data to file). Got HTTP code 200 but ho data changes in database. Service provider inform me I am trying "update nothing" (sending PATCH request with no data), but I can check it. Anybody see any problem in my curl command construction?

echo { "custom_id": "90433", "name": "Aleš Bržďucha", "street": "ěščřžýáíé 9", "city": "Uhl 4", "zip": "", "variable_symbol": "0", "email": "dfgdfg@zrttr.cdf", "phone": "4748596" } | tail --bytes=+4 | curl.exe --include --header "user-agent: My App" --header "content-type: application/json; charset=utf-8" --insecure --request PATCH -u "%login%:%passwd%" -so - --data-binary "@-" --url "https://%service_url%"

Windows 7/64bit, curl 7.39.0

The 'tail' command stripping BOM from data, without tail I got error 500 "Bad unicode".

L.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-06-02