Skip to content

Tag: curl

PHP multipart form data PUT request?

I’m writing a RESTful API. I’m having trouble with uploading images using the different verbs. Consider: I have an object which can be created/modified/deleted/viewed via a post/put/delete/get request to a URL. The request is multi part form when there is a file to upload, or application/xml when …

Php Curl adding Params

Im a newbie im trying to get a script to trigger another script with Curl in PHP but it dosent seem to be sending the paramaters. Is there a seperate function to append parameters? Could anyone point me in the right direction?? Answer You need curl_setopt() along with the CURLOPT_POSTFIELDS param. That’…

remove comments from html source code

I know how to get the html source code via cUrl, but I want to remove the comments on the html document (I mean what is between <!– .. –>). In addition, if I can take just the BODY of the html document. thank you. Answer Try PHP DOM*: Output:

Send string as a file using curl and php

I know I can use this syntaxt to send a file using php, post and curl. $post = array( “file_box”=>”@/path/to/myfile.jpg”, ); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); How can I take a …

PHP – Debugging Curl

I’d like to see what the post fields in the request are before I send it. (For debugging purposes). The PHP library (class) I am using is already made (not by me), so I am trying to understand it. As far as I can tell, it uses curl_setopt() to set different options like headers and such and then it uses