PHP Classes

RESTful

Recommend this page to a friend!

      Horus Curl  >  All threads  >  RESTful  >  (Un) Subscribe thread alerts  
Subject:RESTful
Summary:RESTFul
Messages:2
Author:Enrique
Date:2014-07-17 13:29:30
Update:2014-07-17 15:06:25
 

 


  1. RESTful   Reply   Report abuse  
Picture of Enrique Enrique - 2014-07-17 13:29:30
Hi there!

i dont know if you do it on porpuse, but you did this CURL class RESTful. Just 2 things:

1.- delete all the var_dumps() before upload stuffs :)
2.- you can refactor/recicle the post method eliminating the option:

$this->opts[CURLOPT_POST]

by leaving the option

$this->opts[CURLOPT_CUSTOMREQUEST] = strtoupper(trim($method));

will work like a charm (tested on php 5.5). Therefore, rename the function to something like:

public function httpRequest(array $data, string $method){}

Good class BTW im going to use it on my own projects!

I really hope that this can become useful.

C-Ya! Greetings from Venezuela!

  2. Re: RESTful   Reply   Report abuse  
Picture of Mohammed Al Ashaal Mohammed Al Ashaal - 2014-07-17 15:06:26 - In reply to message 1 from Enrique
Thanks ^_^