You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,15 @@ The library provides a single client and multiple request classes to send reques
23
23
24
24
// Retrieve user with uid 314031.
25
25
$client = new Client();
26
-
$user_request = new UserRequest(314031);
26
+
$user_request = new UserRequest('314031');
27
27
$user = $client->getEntity($user_request);
28
28
29
29
There are various request classes to retrieve different types of entities and entity listings. Many of the entity request classes have a corresponding list request class as well, e.g. `CommentRequest` and `CommentCollectionRequest`.
30
+
31
+
### User Agent
32
+
33
+
In accordance with responsible usage of Drupal.org API, it is important to set the user-agent header to indicate your application. You may set this request once globally using the static property on the `Request` class.
You have to do this only once as this user-agent is applied to all child requests as well. See the test in `\Hussainweb\DrupalApi\Tests\Request\RequestTest::testRequestUserAgent` for verifying the behaviour.
0 commit comments