这是indexloc提供的服务,不要输入任何密码
Skip to content

POST methods broken #165

@inkpot-monkey

Description

@inkpot-monkey

First let me say thanks for this great API.

I've noticed while playing around with it that all the POST methods seem to be broken i.e.:

❯ curl --location 'https://countriesnow.space/api/v0.1/countries/states' \
--data '{
    "country": "Nigeria"
}'
{"error":true,"msg":"missing param (country or iso2)"}

I've got these requests to work with the query string, IE

❯ curl --location 'https://countriesnow.space/api/v0.1/countries/states/?country="Nigeria"'

So I am guessing something is going wrong with the Middleware redirection in

* Redirect all POST requests by appending "/q" to the end of the route

Is there anyway of investigating this further? I've cloned the repo and the tests pass, which contradicts my lived experience.

Alternatively, is it time to remove all the POST requests (at least in the documentation) for their proper GET versions? I'm happy to take this on

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions