Skip to content

Commit b8a52de

Browse files
author
Sander de Vos
committed
Download files
1 parent 58bceae commit b8a52de

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Sendcloud.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ public function shippingMethods(array $optionalParameters = []): array
5252
return $this->request('get', $endpoint);
5353
}
5454

55+
public function download(string $url): string
56+
{
57+
$response = Http::withBasicAuth(config('sendcloud.key'), config('sendcloud.secret'))
58+
->get($url);
59+
60+
$response->throw();
61+
62+
return $response->body();
63+
}
64+
5565
private function request(string $method, string $endpoint, array $data = [], bool $throwException = true): array
5666
{
5767
$response = Http::withBasicAuth(config('sendcloud.key'), config('sendcloud.secret'))

0 commit comments

Comments
 (0)