|
@@ -3,7 +3,6 @@ ixudra/curl
|
|
|
|
|
|
[](https://packagist.org/packages/ixudra/curl)
|
|
|
[]()
|
|
|
-[](https://styleci.io/repos/18486198)
|
|
|
[](https://packagist.org/packages/ixudra/curl)
|
|
|
|
|
|
|
|
@@ -18,7 +17,7 @@ use cURL requests and also makes your code more comprehensible.
|
|
|
|
|
|
The provided functionality is completely framework-independent but also contains a Laravel service provider for easy
|
|
|
integration into your Laravel project.
|
|
|
-
|
|
|
+
|
|
|
|
|
|
> Note before posting an issue: When posting an issue for the package, always be sure to provide as much information
|
|
|
> regarding the request as possible. This includes the example cURL request you are trying to transfer into the package
|
|
@@ -272,6 +271,26 @@ Delete requests work similar to `GET` requests, but use the `delete()` method in
|
|
|
```
|
|
|
|
|
|
|
|
|
+### Sending HEAD requests
|
|
|
+
|
|
|
+HEAD requests work similar to `GET` requests, but use the `head()` method instead:
|
|
|
+
|
|
|
+```php
|
|
|
+
|
|
|
+ use Ixudra\Curl\Facades\Curl;
|
|
|
+
|
|
|
+ // Send a HEAD request to: http://www.foo.com/bar/1
|
|
|
+ $response = Curl::to('http://www.foo.com/bar/1')
|
|
|
+ ->head();
|
|
|
+
|
|
|
+ // Send a HEAD request to: http://www.foo.com/bar/1?foz=baz
|
|
|
+ $response = Curl::to('http://www.foo.com/bar/1')
|
|
|
+ ->withData( array( 'foz' => 'baz' ) )
|
|
|
+ ->head();
|
|
|
+
|
|
|
+```
|
|
|
+
|
|
|
+
|
|
|
### Sending custom headers
|
|
|
|
|
|
Sending custom headers is easy with the `withHeader()` method. Multiple calls can be chained together to add multiple headers to the request:
|
|
@@ -555,6 +574,10 @@ use the facades to access the `CurlService`.
|
|
|
$response = $curlService->to('http://www.foo.com/bar')
|
|
|
->delete();
|
|
|
|
|
|
+ // Send a HEAD request to: http://www.foo.com/bar
|
|
|
+ $response = $curlService->to('http://www.foo.com/bar')
|
|
|
+ ->head();
|
|
|
+
|
|
|
```
|
|
|
|
|
|
|