[wp-trac] [WordPress Trac] #17490: cURL fails with timeout when posting to a location that redirects

WordPress Trac wp-trac at lists.automattic.com
Fri Dec 2 00:44:58 UTC 2011


#17490: cURL fails with timeout when posting to a location that redirects
--------------------------+-----------------------------
 Reporter:  simsmaster    |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  HTTP          |     Version:  3.2
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+-----------------------------

Comment (by mdawaffe):

 Check out cURL's {{{CURLOPT_POSTREDIR}}} (added in cURL 7.19.1).  The
 constant is defined in PHP (as of 5.3.2) but undocumented.

 For example, the following tells cURL to maintain the HTTP method after
 either a 301 or 302 redirect.

 {{{
 curl_setopt( $handle, CURLOPT_POSTREDIR, 3 );
 }}}

 In the absence of {{{CURLOPT_POSTREDIR}}} support, doing

 {{{
 curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, 'POST' );
 }}}

 rather than relying on

 {{{
 curl_setopt( $handle, CURLOPT_POST, true );
 }}}

 ''may'' help in some cases as well.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17490#comment:15>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list