johanhaleby / stub-http

Client library agnostic way to stub HTTP endpoints in Clojure
MIT License
70 stars 10 forks source link

Body match always fails with PUT request #16

Open xelnaga opened 3 years ago

xelnaga commented 3 years ago

Setting up a route for a PUT request with a body will always fail to match the body.

This is because the PUT body data is keyed on the request with "content" and not "postData".

Line 34 of stub-http.internal.spec needs to use the method to determine the correct key.

xelnaga commented 3 years ago

It appears that a PATCH request also has some problems with the body not coming through at all. Perhaps this is a limitation of NanoHttpd?

johanhaleby commented 3 years ago

I think it's a limitation of NanoHttpd unfortunately :(