Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
christyjacob4 committed Mar 18, 2024
1 parent 3096305 commit 4651afe
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Utopia Fetch
Lite & fast micro PHP library that provides a convenient and flexible way to perform HTTP requests in PHP applications. It now supports a more object-oriented approach, allowing for fine-grained control over request configuration such as timeouts, redirects, and headers.
Lite & fast micro PHP library that provides a convenient and flexible way to perform HTTP requests in PHP applications.

## Usage
Create an instance of the `Client` class to perform HTTP requests. The instance methods allow for setting request options like headers, timeout, connection timeout, and more.
Expand Down Expand Up @@ -32,8 +32,12 @@ $method = 'GET';
$query = ['foo' => 'bar'];

// Optionally set more configurations
$client->setUserAgent('CustomUserAgent/1.0')
->setTimeout(30);
$client
->setUserAgent('CustomUserAgent/1.0')
->setAllowRedirects(true)
->setMaxRedirects(1)
->setConnectionTimeout(10)
->setTimeout(30);

$resp = $client->fetch(
url: $url,
Expand Down

0 comments on commit 4651afe

Please sign in to comment.