Getting HEAD url 405 () error when clicking on NON-GET
brocoly27 opened this issue · 1 comments
Hi, I'm playing with string boot and the HAL browser but I'm getting 405 every time I click on 'Non Get' icon.
I'm new with this tool and I'm not sure what I'm missing. I have an existing REST service created with Spring using @RestController, my endpoint is:
POST http://localhost:8080/api/v1/invoice/report/request
and I have that endpoint registered on the Hal Browser at http://localhost:8080/. This is the what I see on the screen:
{ "_links": { "invoicing:request": { "href": "http://localhost:8080/api/v1/invoice/report/request" }, "profile": { "href": "http://localhost:8080/profile" } } }
However, on the left side (NON-GET column) I'm unable to see the popup dialog to Make a Request, I'm not sure what I'm doing wrong.
Thanks
Note. Something I noticed is that if my endpoint is GET, then I do see the popup.
Hal browser makes a HEAD request to your provided link to check headers. Spring mvc only provides HEAD support for endpoints that serve GET-Requests.
since your endpoint only serves post requests the Head request fails. imho this is a bug. the head failure should be ignored and the normal make a non-get request be shown. (this is basicly what already happens if you force the issue by calling the correct hal browser url yourself)