Important HTTP request headers shows sending */*
for the Accept
header:
In every request should be present these HTTP headers, otherwise request could fail.
Accept: */*
However examples in various methods, such as Login, show the Accept
header set to application/json
:
curl --request POST \
--url https://api.opensubtitles.com/api/v1/login \
--header 'Accept: application/json' \
--header 'Api-Key: ' \
--header 'Content-Type: application/json' \
--header 'User-Agent: ' \
--data '{
"username": "string",
"password": "string"
}'
I would think the normal REST API requests sent by clients should use application/json
as shown in the examples. Only the special GET request for the subtitle file contents would need to use */*
.
What is the best practice?