HOWTO: Do PUT requests with PHP cURL without writing to a file

sugarcrmdevelopers —  November 22, 2011 — 11 Comments

11 responses to HOWTO: Do PUT requests with PHP cURL without writing to a file

  1. 

    Why not just use POST?

  2. 

    This was exactly what I needed. Thank you!

  3. 
    PUTting up with myself March 26, 2012 at 2:09 am

    and… after hours of struggling I find the exact brilliant answer i needed. Thank you so incredibly much for this 🙂

  4. 

    good work

  5. 

    This is great and exactly what I was looking for! Thank you so much.
    Unfortunately there is not much information about HTTP PUT on the web so I was struggling to make my request for quite a while…

  6. 

    Just so everyone knows, the data in the $update_json variable will be available in the $_REQUEST array on the receiving script that is being cURLd to.

  7. 

    sweet 🙂

  8. 

    Or you could just write to memory – for those that can use fwrite():
    $fp = fopen(‘php://temp/maxmemory:256000’, ‘w’);
    fwrite($fp, $message);
    fseek($fp, 0);

    That’ll write up to 256kb to memory before writing to disk.

  9. 

    Thanks this works great, saves messing about with file nonsense!

  10. 

    Greate work! 10x!!! It really helped me.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s