+
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ Use the `Minicli/Curl/Client` class to make GET and POST requests using the `get
This example queries the DEV API and gets the latest posts from a user:

```php
$crawler = new Client();
$crawler = new Client();

$articles_response = $crawler->get('https://dev.to/api/articles?username=erikaheidi');
$articles_response = $crawler->get('https://dev.to/api/articles?username=erikaheidi');

if ($articles_response['code'] !== 200) {
$app->getPrinter->error('Error while contacting the dev.to API.');
return 1;
}
$articles = json_decode($articles_response['body'], true);
print_r($articles);
if ($articles_response['code'] !== 200) {
$app->getPrinter->error('Error while contacting the dev.to API.');
return 1;
}

$articles = json_decode($articles_response['body'], true);
print_r($articles);
```

The following single-command Minicli application will fetch a user's latest stats from DEV.to using Curly (this requires `minicli/minicli`):
Expand Down Expand Up @@ -82,5 +82,3 @@ try {

return 0;
```


点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载