Does anyone have an example of how to create a post request with curl? The get example provided works well, but I can't understand how to properly construct the post body. Should all the oauth data (key,signature etc) be json encoded as well as the parameters and passed as the postfield?
Hi, our API expert is on a short break this week - he'll return next week and he'll get back to you then. Cheers, Bart
Hi, There are no examples of making a POST request with curl at the moment. Are you able to use the oauth library provided by pecl? We have examples for those here: https://github.com/Shapeways/shapeways-api/tree/master/php-p ecl -Beekey
Hi all, I think the concern is mainly around how to properly configure the OAuth header. In the PHP examples, the OAuth header is created by a pecl library, aptly named Oauth. You can see from the Authorize script that it is being created with new Oauth(...); https://github.com/Shapeways/shapew.../AuthorizeWithRequestUriQuery-oauth1-curl.php The above script goes through the steps to essentially do what the pecl library does to format the Header. I wouldn't recommend it as it's more trouble than it's worth. What would you like to test? I can point to more consumer friendly methods off the command line that can accomplish the same thing. Have you looked into Postman? It puts a friendly GUI for testing APIs. Let me know if you want to learn how to use it for your use case. Not sure what is meant by the provider doesn't offer Oauth.
(Sorry maybe I used the wrong discussion thread since I searched for any other solution and was sure that in some thread it was also mentioned that the Oauth package is not provided by the provider) Php (5.6) is installed and managed by my Web Provider. The installation includes pecl but not the Oauth class. So I can't use the example scripts since Oauth is not defined then. Maybe that can be used instead of the pecl/Oauth but I don't have the time to check it. https://www.phpclasses.org/package/7700-PHP-Authorize-and-access-APIs-using-OAuth.html