cURL "PUT" question  (PHP)

willsherwood used Ask the Experts™
I have an API command i want to implement to ADD an email addr to an addr list in constant contact.
I'm familiar in general with using cURL for simple  URLs that have ?GET parameters built in to the URL (and that's it for the data that i send to the API in other cases)
ConstantContact has the command/data in XML (which is fine), but it is suggested to put it in a file and then do a PUT using cURL.

My question is:   do i have to go to the trouble of making it a file and using PUT,  wouldn't there be a similar/equivalent method/strategy to just make a 10-line text string and send that as the parameter data for the cURL operation?

If there is a similar way, in general does an API care which method was used (PUT vs. others).

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Fixer of Problems
Most Valuable Expert 2014
Yes, they care because the processing, just like in PHP, depends on the method used.  In PHP, GETs are in the $_GET array and POSTs are in the $_POST array.  All web servers and programming languages use these distinctions as far as I know.


aha,  sounds like i need to go ahead and write a file, etc.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial