http://guzzlephp.org/
I wrote a wrapper for BTC-e REST API using Guzzle and Symfony framework. Even if you're not using Symfony, the client.xml service description can still be used with Guzzle to execute requests against BTC-e.
The BTC-e API actually has a few really annoying bugs and limitations (no market orders, missing the trade order ID if the order was executed immediately, etc....). I haven't made the code public on my GitHub yet because it's embedded with an app. PM if you'd like me to send you the source and I can share as well as explain the API bugs I encountered and how I worked around them. Hopefully this is helpful.
Links to a few potentially useful pastebins:
- guzzle client.xml: http://pastebin.com/sgZNU8ew
- guzzle Client class to handle BTC-e authentication: http://pastebin.com/DzkfN3Cy
- guzzle Command class to handle BTC-e authentication: http://pastebin.com/nGmYCCjr
That is a lot of extra files and calls for a very simple function.
You could write a one-off script to call CURL manually and end up with a lot of repetitious code (violation of "DRY"). Guzzle library implements the command pattern to abstract away all the boilerplate stuff so that all you need to do is describe the web service, rather than write code for every API method the exchange supports. You get a lot of stuff for free using guzzle such as validation of API parameters.
If you plan to integrate with other exchanges at some point or even just to implement more of BTC-e's API methods, I highly suggest wrapping them with Guzzle.
ok but clearly op just wants to do a one off trade not add in all the exchanges which can be easier other abstracted ways. Probably not the way for OP to go.