Skip to content

Commit

Permalink
Update client.md
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue authored Sep 20, 2023
1 parent 42a20ad commit 5afb5a1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/src/6.x/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,19 @@ $response = $api->postJson('/cgi-bin/user/info/updateremark', [
```php
get(string $uri, array $options = []): Symfony\Contracts\HttpClient\ResponseInterface
post(string $uri, array $options = []): Symfony\Contracts\HttpClient\ResponseInterface
postJson(string $url, array $options = []): Symfony\Contracts\HttpClient\ResponseInterface
patch(string $uri, array $options = []): Symfony\Contracts\HttpClient\ResponseInterface
put(string $uri, array $options = []): Symfony\Contracts\HttpClient\ResponseInterface
delete(string $uri, array $options = []): Symfony\Contracts\HttpClient\ResponseInterface
```

同时还内置了一些便捷方法:

```php
postJson(string $url, array $data = [], array $options = []): Symfony\Contracts\HttpClient\ResponseInterface
patchJson(string $url, array $data = [], array $options = []): Symfony\Contracts\HttpClient\ResponseInterface
postXml(string $url, array $data = [], array $options = []): Symfony\Contracts\HttpClient\ResponseInterface
```

`$options` 为请求参数,可以指定 `query`/`body`/`json`/`xml`/`headers` 等等,具体请参考:[HttpClientInterface::OPTIONS_DEFAULTS](https://github.com/symfony/symfony/blob/6.1/src/Symfony/Contracts/HttpClient/HttpClientInterface.php)

---
Expand Down

1 comment on commit 5afb5a1

@vercel
Copy link

@vercel vercel bot commented on 5afb5a1 Sep 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

easywechat – ./

easywechat-overtrue.vercel.app
easywechat-git-6x-overtrue.vercel.app
easywechat.vercel.app

Please sign in to comment.