mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 11:30:12 +03:00
Update - RequestsClient needs fully qualified URLs
Note that the requests client requires you to pass fully qualified URLs.
This commit is contained in:
parent
2983f1c53a
commit
43c4a1fedb
|
@ -238,12 +238,12 @@ For example...
|
|||
client = RequestsClient()
|
||||
|
||||
# Obtain a CSRF token.
|
||||
response = client.get('/homepage/')
|
||||
response = client.get('http://testserver/homepage/')
|
||||
assert response.status_code == 200
|
||||
csrftoken = response.cookies['csrftoken']
|
||||
|
||||
# Interact with the API.
|
||||
response = client.post('/organisations/', json={
|
||||
response = client.post('http://testserver/organisations/', json={
|
||||
'name': 'MegaCorp',
|
||||
'status': 'active'
|
||||
}, headers={'X-CSRFToken': csrftoken})
|
||||
|
|
Loading…
Reference in New Issue
Block a user