[Fixed]-How to make post request in Django TastyPie using ApiKeyAuthentication

1👍

from documentation:

Authorization: ApiKey daniel:204db7bcfafb2deb7506b89eb3b9b715b09905c8

your request must be like this:

requests.post('http://localhost/api/entry/',
              json={"key1": "value1",
                    "key2": "value2"},
              headers={"content-type": "application/json",
                       "Authorization": "ApiKey <username>:<api_key>"})

Leave a comment