0

I'm using GO and chi router trying to create and endpoint filtering a table by status, but when I use the ? on the URL I'm receiving 404 page not found.

I am using the following code:

r.Get("/table?status={status}", l.Hanlder(tableHandler.GetByStatus))

When I remove the ? it works just well. I can't use it to filter? I can not, how can I do it?

Thanks in advance.

  • Does this answer your question? [golang Chi router with query params not working](https://stackoverflow.com/questions/51933367/golang-chi-router-with-query-params-not-working) – Clark McCauley Jun 09 '21 at 15:04

1 Answers1

1

You can use the URLParam or URLParamFromCtx function to get the value of a query string parameter.

Riwen
  • 4,734
  • 2
  • 19
  • 31