mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 20:36:39 +08:00
f03b293e6a
Now you can also make authenticated API requests by passing the `api_key` and `api_username` in the HTTP header instead of query params. The new header values are: `Api-key` and `Api-Username`. Here is an example in cURL: ``` text curl -i -sS -X POST "http://127.0.0.1:3000/categories" \ -H "Content-Type: multipart/form-data;" \ -H "Api-Key: 7aa202bec1ff70563bc0a3d102feac0a7dd2af96b5b772a9feaf27485f9d31a2" \ -H "Api-Username: system" \ -F "name=7c1c0ed93583cba7124b745d1bd56b32" \ -F "color=49d9e9" \ -F "text_color=f0fcfd" ``` There is also support for `Api-User-Id` and `Api-User-External-Id` instead of specifying the username along with the key. |
||
---|---|---|
.. | ||
auth_provider.rb | ||
authenticator.rb | ||
current_user_provider.rb | ||
default_current_user_provider.rb | ||
facebook_authenticator.rb | ||
github_authenticator.rb | ||
google_oauth2_authenticator.rb | ||
instagram_authenticator.rb | ||
managed_authenticator.rb | ||
oauth2_authenticator.rb | ||
open_id_authenticator.rb | ||
result.rb | ||
twitter_authenticator.rb |