Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regional API (Beta) should ignore any spurious Content-Type in GET request #16

Open
joth76 opened this issue Aug 31, 2023 · 0 comments
Open

Comments

@joth76
Copy link

joth76 commented Aug 31, 2023

If a client sends a text/html Content-Type header in the get request (spurious, but not disallowed) then it causes the API to error:

$ curl  --header "Content-Type: text/html" https://api.carbonintensity.org.uk:443/regional/regionid/10
{
"error": {
  "code": "400 Bad Request",
  "message":  "Unsupported Media Type"
  }

This header is correctly ignored in the national API and works finr, it's only the Regional API that appears to choke on it.


$ curl  --header "Content-Type: text/html" https://api.carbonintensity.org.uk/intensity
{
  "data":[{
    "from": "2023-08-31T11:30Z",
    "to": "2023-08-31T12:00Z",
    "intensity": {
      "forecast": 191,
      "actual": 190,
      "index": "moderate"
    }
  }]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant