Forums/Developer Program/Developer questions & answers

Answered

examples using curl from php or jscript?

Chris Chalmers
asked this on May 01, 2012 17:42

Sorry, I'm a bit of a newbie here. I see all of the nice, simple curl examples here: http://www.ponoko.com/app-gateway/api-documentation and here: http://support.ponoko.com/entries/20865397-ponoko-api-curl-call-examples but I don't know how to implement them in a website. For example,  how would the syntax of -d and -F parameters fit into the php context I've found here: http://tournasdimitrios1.wordpress.com/2010/10/17/php-basics-accessing-remote-urls-using-curl/ ?

Should the calls to -d of -F be made within the curl_setopt(); wrapper and if so, what syntax?

 

Some examples of basic php usage for the ponoko API would be great. 

Also, I'm by no means set on using php. If there's a better way to go for web-based API access please let me know which language to use and how to implement it in the browser. As I said, just getting my head around this...


Thanks!

 

Comments

User photo
Nahum Wild
Ponoko

Hi Chris.

I don't really know PHP at all, but you don't have to actually use cURL for accessing our API as you could instead use an HTTP wrapper library for your language of choice. A quick google gives me this: http://php.net/manual/en/httprequest.send.php as looking like it could be helpful. It looks to easily allowing posting files, which is the main thing you'll need to do.

In terms of other languages, we have created a Ruby gem that wraps around the API and makes it even easier to use: https://github.com/Ponoko/ponoko And we've had a guest post on our blog about using Python: http://blog.ponoko.com/2012/01/29/tutorial-getting-started-with-the...

 

--Nahum

May 01, 2012 18:40