{ "url": "<feedURL>" }
Description: Creates a feed from <feedUrl>
by making a HTTP request to the feed URL and saving it to the database.
This operation will fail if (in order):
- Feed URL is an invalid URI (validation error)
- A feed already exists with the requested feed URL (must be unique: validation error)
- Feed URL does not resolve to a host
- The request to the feed URL returns a bad status code (e.g. 404)
- The response is not a feed, but something else (e.g. a HTML page)
- The response is a feed, but is missing a title (invalid feed: validation error(?))
For each of these potential failure areas, how should the API respond?
- Obivously a client error and should return a 400
- Obivously a client error and should return a 400
- The client input was valid, so what status code should this return?
- The client input was valid, so what status code should this return?
- The client input was valid, so what status code should this return?
- The client input was valid, so what status code should this return? Technically this is an error when validating the feed (the title is required).
3/4/5) ditto.
For these cases you can return a document explaining exactly what went wrong and how the client can fix it.