From 8dcb11e0a64876b1ef0a7535f8e29bd1a4c62ab4 Mon Sep 17 00:00:00 2001 From: Ahmad Nassri Date: Thu, 15 Jan 2015 01:46:21 -0500 Subject: [PATCH] updating README with new info --- README.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6d902d4..0d14551 100644 --- a/README.md +++ b/README.md @@ -120,11 +120,11 @@ $response = Unirest\Request::get("http://httpbin.org/get", null, null, "username ### Request Object ```php -Unirest\Request::get($url, $headers = array(), $parameters = NULL, $username = NULL, $password = NULL) -Unirest\Request::post($url, $headers = array(), $body = NULL, $username = NULL, $password = NULL) -Unirest\Request::put($url, $headers = array(), $body = NULL, $username = NULL, $password = NULL) -Unirest\Request::patch($url, $headers = array(), $body = NULL, $username = NULL, $password = NULL) -Unirest\Request::delete($url, $headers = array(), $body = NULL, $username = NULL, $password = NULL) +Unirest\Request::get($url, $headers = array(), $parameters = null, $username = null, $password = null) +Unirest\Request::post($url, $headers = array(), $body = null, $username = null, $password = null) +Unirest\Request::put($url, $headers = array(), $body = null, $username = null, $password = null) +Unirest\Request::patch($url, $headers = array(), $body = null, $username = null, $password = null) +Unirest\Request::delete($url, $headers = array(), $body = null, $username = null, $password = null) ``` - `url` - Endpoint, address, or uri to be acted upon and requested information from. @@ -133,6 +133,14 @@ Unirest\Request::delete($url, $headers = array(), $body = NULL, $username = NULL - `username` - Basic Authentication username - `password` - Basic Authentication password +You can send a request with any [standard](http://www.iana.org/assignments/http-methods/http-methods.xhtml) or custom HTTP Method: + +```php +Unirest\Request::send(Unirest\Methods::LINK, $url, $headers = array(), $body); + +Unirest\Request::send('CHECKOUT', $url, $headers = array(), $body); +``` + ### Response Object Upon recieving a response Unirest returns the result in the form of an Object, this object should always have the same keys for each language regarding to the response details.