PHP cURL HTTP PUT

Just been doing that myself today… here is code I have working for me… $data = array(“a” => $a); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “PUT”); curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($data)); $response = curl_exec($ch); if (!$response) { return false; } src: http://www.lornajane.net/posts/2009/putting-data-fields-with-php-curl

How do I allow a PUT file request on Nginx server?

To add HTTP and WebDAV methods like PUT, DELETE, MKCOL, COPY and MOVE you need to compile nginx with HttpDavModule (./configure –with-http_dav_module). Check nginx -V first, maybe you already have the HttpDavModule (I installed nginx from the Debian repository and I already have the module). Then change your nginx-config like that: location / { root … Read more

How to send a POST request with BODY in swift

If you are using Alamofire v4.0+ then the accepted answer would look like this: let parameters: [String: Any] = [ “IdQuiz” : 102, “IdUser” : “iosclient”, “User” : “iosclient”, “List”: [ [ “IdQuestion” : 5, “IdProposition”: 2, “Time” : 32 ], [ “IdQuestion” : 4, “IdProposition”: 3, “Time” : 9 ] ] ] Alamofire.request(“http://myserver.com”, method: … Read more