Skip to content

Commit

Permalink
improved syntax and some codes. (#108)
Browse files Browse the repository at this point in the history
* improved syntax and some codes.

* back to original for Body.php
  • Loading branch information
irfanevrens authored and Ahmad Nassri committed May 31, 2016
1 parent 53656bf commit 5d304c6
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions src/Unirest/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

namespace Unirest;

use Unirest\Method as Method;
use Unirest\Response as Response;
use Unirest\Exception as Exception;

class Request
{
private static $cookie = null;
Expand Down Expand Up @@ -86,6 +82,7 @@ public static function timeout($seconds)
* Set default headers to send on every request
*
* @param array $headers headers array
* @return array
*/
public static function defaultHeaders($headers)
{
Expand Down Expand Up @@ -232,7 +229,7 @@ public static function proxyAuth($username = '', $password = '', $method = CURLA
* @param mixed $parameters parameters to send in the querystring
* @param string $username Authentication username (deprecated)
* @param string $password Authentication password (deprecated)
* @return Unirest\Response
* @return Response
*/
public static function get($url, $headers = array(), $parameters = null, $username = null, $password = null)
{
Expand All @@ -246,7 +243,7 @@ public static function get($url, $headers = array(), $parameters = null, $userna
* @param mixed $parameters parameters to send in the querystring
* @param string $username Basic Authentication username (deprecated)
* @param string $password Basic Authentication password (deprecated)
* @return Unirest\Response
* @return Response
*/
public static function head($url, $headers = array(), $parameters = null, $username = null, $password = null)
{
Expand All @@ -260,7 +257,7 @@ public static function head($url, $headers = array(), $parameters = null, $usern
* @param mixed $parameters parameters to send in the querystring
* @param string $username Basic Authentication username
* @param string $password Basic Authentication password
* @return Unirest\Response
* @return Response
*/
public static function options($url, $headers = array(), $parameters = null, $username = null, $password = null)
{
Expand All @@ -274,7 +271,7 @@ public static function options($url, $headers = array(), $parameters = null, $us
* @param mixed $parameters parameters to send in the querystring
* @param string $username Basic Authentication username (deprecated)
* @param string $password Basic Authentication password (deprecated)
* @return Unirest\Response
* @return Response
*/
public static function connect($url, $headers = array(), $parameters = null, $username = null, $password = null)
{
Expand All @@ -288,7 +285,7 @@ public static function connect($url, $headers = array(), $parameters = null, $us
* @param mixed $body POST body data
* @param string $username Basic Authentication username (deprecated)
* @param string $password Basic Authentication password (deprecated)
* @return Unirest\Response response
* @return Response response
*/
public static function post($url, $headers = array(), $body = null, $username = null, $password = null)
{
Expand All @@ -302,7 +299,7 @@ public static function post($url, $headers = array(), $body = null, $username =
* @param mixed $body DELETE body data
* @param string $username Basic Authentication username (deprecated)
* @param string $password Basic Authentication password (deprecated)
* @return Unirest\Response
* @return Response
*/
public static function delete($url, $headers = array(), $body = null, $username = null, $password = null)
{
Expand All @@ -316,7 +313,7 @@ public static function delete($url, $headers = array(), $body = null, $username
* @param mixed $body PUT body data
* @param string $username Basic Authentication username (deprecated)
* @param string $password Basic Authentication password (deprecated)
* @return Unirest\Response
* @return Response
*/
public static function put($url, $headers = array(), $body = null, $username = null, $password = null)
{
Expand All @@ -330,7 +327,7 @@ public static function put($url, $headers = array(), $body = null, $username = n
* @param mixed $body PATCH body data
* @param string $username Basic Authentication username (deprecated)
* @param string $password Basic Authentication password (deprecated)
* @return Unirest\Response
* @return Response
*/
public static function patch($url, $headers = array(), $body = null, $username = null, $password = null)
{
Expand All @@ -344,7 +341,7 @@ public static function patch($url, $headers = array(), $body = null, $username =
* @param mixed $body TRACE body data
* @param string $username Basic Authentication username (deprecated)
* @param string $password Basic Authentication password (deprecated)
* @return Unirest\Response
* @return Response
*/
public static function trace($url, $headers = array(), $body = null, $username = null, $password = null)
{
Expand Down Expand Up @@ -385,14 +382,14 @@ public static function buildHTTPCurlQuery($data, $parent = false)

/**
* Send a cURL request
* @param Unirest\Method|string $method HTTP method to use
* @param \Unirest\Method|string $method HTTP method to use
* @param string $url URL to send the request to
* @param mixed $body request body
* @param array $headers additional headers to send
* @param string $username Authentication username (deprecated)
* @param string $password Authentication password (deprecated)
* @throws Unirest\Exception if a cURL error occurs
* @return Unirest\Response
* @throws \Unirest\Exception if a cURL error occurs
* @return Response
*/
public static function send($method, $url, $body = null, $headers = array(), $username = null, $password = null)
{
Expand Down

0 comments on commit 5d304c6

Please sign in to comment.