[wp-hackers] Sending checkbox parameters to a non-PHP script using wp_remote_post

Mike Walsh mpwalsh8 at gmail.com
Sun Jan 29 13:49:55 UTC 2012

Thanks a bunch for the pointer to http://httpbin.org and the suggestion for
manually building the body parameter for wp_remote_post().  The web site in
particular was extremely helpful in solving my problem (which is now
working - yeah!) as it allowed me to get my post using wp_remote_post() to
match exactly what going through the normal Google Form process posts.


On Sat, Jan 28, 2012 at 12:09 PM, Ryan McCue <lists at rotorised.com> wrote:

> [ ... snipped ... ]
> The raw HTTP data to the PHP script will look something like:
>        icecream[]=a&icecream[]=b&icecream[]=c
> It sounds like what you'll want for the other API is something like:
>        icecream=a&icecream=b&icecream=c
> To do that, you'll have to create the string yourself and send that as
> the 'body' option to wp_remote_post(), as it appears http_build_query()
> and family don't handle this (which IIRC, is what WP_Http will use
> internally).
> (If you want to doublecheck any of this, try sending a GET/POST request
> to one of the http://httpbin.org/ URLs; they're fantastic for testing
> with.)
> --
> Ryan McCue
> <http://ryanmccue.info/>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

Mike Walsh - mpwalsh8 at gmail.com

More information about the wp-hackers mailing list