Solved

cURL "PUT" question  (PHP)

Posted on 2013-01-15
2
433 Views
Last Modified: 2016-03-18
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).

thanks
0
Comment
Question by:willsherwood
2 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 38780957
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.
0
 

Author Comment

by:willsherwood
ID: 38780970
aha,  sounds like i need to go ahead and write a file, etc.
thanks!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now