horst Posted April 3, 2019 Share Posted April 3, 2019 Hi, I get this error message when trying to communicate with a mailchimp server: Exception: Raw data option with CURL not supported for PATCH (in .../wire/core/WireHttp.php line 670) This will be triggered from this code: $http = new WireHttp(); $http->setHeaders([ 'Content-Type' => 'application/json', 'Authorization' => 'Basic '.base64_encode('user:'.$this->api_key), ]); $response = $http->send($api . '/' . md5($email), json_encode($param), 'PATCH'); Can somebody tell me what this mean and how I can avoid it? OR: On other servers I use the same module / code without any errors. How can I find out what is differend here? Link to comment Share on other sites More sharing options...
Autofahrn Posted April 3, 2019 Share Posted April 3, 2019 never used PATCH before, so its only guessing... Could it be 'Content-Type' => 'application/json-patch+json', https://tools.ietf.org/html/rfc6902 1 Link to comment Share on other sites More sharing options...
horst Posted April 3, 2019 Author Share Posted April 3, 2019 57 minutes ago, Autofahrn said: Could it be 'Content-Type' => 'application/json-patch+json', Tested and it doesn't work too. ? 1 Link to comment Share on other sites More sharing options...
cstevensjr Posted April 3, 2019 Share Posted April 3, 2019 May not be much help, but here goes: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH https://www.electrictoolbox.com/php-curl-http-referer/ https://www.weichieprojects.com/blog/curl-api-calls-with-php/ https://curl.haxx.se/docs/manpage.html 1 Link to comment Share on other sites More sharing options...
qtguru Posted April 3, 2019 Share Posted April 3, 2019 Out of curiosity, can you dump the data being sent out and validate it's the proper data you intend to send also this stackoverflow also details a way of making PATCH curl calls. https://stackoverflow.com/questions/14451401/how-do-i-make-a-patch-request-in-php-using-curl 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now