Skip to content

Commit 13688cf

Browse files
authored
Merge pull request #4 from yael-lorenzo-olx/patch-1
Add support for HEAD http request.
2 parents 3148df7 + 04880cf commit 13688cf

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

src/HttpClient.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,13 @@ public function delete($uri)
6666
{
6767
return new FluentRequest('DELETE', $uri, $this->client);
6868
}
69+
70+
/**
71+
* @param $uri
72+
* @return FluentRequestInterface
73+
*/
74+
public function head($uri)
75+
{
76+
return new FluentRequest('HEAD', $uri, $this->client);
77+
}
6978
}

src/HttpClientInterface.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,10 @@ public function patch($uri);
3434
* @return FluentRequestInterface
3535
*/
3636
public function delete($uri);
37+
38+
/**
39+
* @param $uri
40+
* @return FluentRequestInterface
41+
*/
42+
public function head($uri);
3743
}

src/Request/RequestExecutor.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ public function execute()
5757
case 'DELETE':
5858
$requestResponse = $this->getClient()->delete($this->uri, $this->options);
5959
break;
60+
case 'HEAD':
61+
$requestResponse = $this->getClient()->head($this->uri, $this->options);
62+
break;
6063
default:
6164
throw new UnsupportedOperationException(sprintf('HTTP METHOD [%s] is not supported.', $this->method));
6265
}

0 commit comments

Comments
 (0)