add Accept header
This commit is contained in:
parent
ee4430945d
commit
516bc00a98
|
@ -93,7 +93,7 @@ Therefore running Nextcloud **with SSL is highly recommended** otherwise **every
|
|||
|
||||
You can test your request using `curl`:
|
||||
|
||||
curl -u user:password https://yournextcloud.com/index.php/apps/notes/api/v1/notes
|
||||
curl -u user:password -H "Accept: application/json" https://yournextcloud.com/index.php/apps/notes/api/v1/notes
|
||||
|
||||
If you have enabled two-factor authentication you will have to create an app specific password for accessing the API. Please see [Nextcloud documentation](https://docs.nextcloud.com/server/latest/user_manual/session_management.html) for further details.
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ The base URL for all calls is:
|
|||
|
||||
All defined routes in the specification are appended to this url. To access all notes for instance use this url (here shown as `curl` command):
|
||||
|
||||
curl -u user:password https://yournextcloud.com/index.php/apps/notes/api/v1/notes
|
||||
curl -u user:password -H "Accept: application/json" https://yournextcloud.com/index.php/apps/notes/api/v1/notes
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ abstract class AbstractAPITest extends TestCase {
|
|||
'base_uri' => 'http://localhost:8080/index.php/apps/notes/api/v'.$v.'/',
|
||||
'auth' => ['test', 'test'],
|
||||
'http_errors' => false,
|
||||
'headers' => ['Accept' => 'application/json'],
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ class CapabilitiesTest extends TestCase {
|
|||
'base_uri' => 'http://localhost:8080/',
|
||||
'auth' => ['test', 'test'],
|
||||
'http_errors' => false,
|
||||
'headers' => ['Accept' => 'application/json'],
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -21,7 +22,6 @@ class CapabilitiesTest extends TestCase {
|
|||
$response = $this->http->request('GET', 'ocs/v2.php/cloud/capabilities', [
|
||||
'headers' => [
|
||||
'OCS-APIRequest' => 'true',
|
||||
'Accept' => 'application/json',
|
||||
]
|
||||
]);
|
||||
$this->assertEquals(200, $response->getStatusCode(), 'Response status code');
|
||||
|
|
Loading…
Reference in New Issue