serve icon indicating copy to clipboard operation
serve copied to clipboard

How to get the URL parameters within the custom inference handler?

Open neoragex2002 opened this issue 3 years ago • 3 comments

Hi guys, recently I'm writing an custom service handler for yolov5. However, I have no idea about how to get the URL parameters in my inference handler.

For example:

curl -XPOST http://localhost:8080/predictions/yolo?my_parameter=123 [email protected]

How can I get the value of my_parameter in my custom service handler?

I know that I could pass the parameters within the multipart/form-data or json body to my service handler. But I can't, because the API signature is by-design. Passing the parameter with URL is the only choice of mine.

Any suggestions would be appreciated!

neoragex2002 avatar Mar 03 '21 09:03 neoragex2002

Currently only BODY of the request is passed to the CustomHandler. The URL params of the Model server's inference endpoint are static and not configurable.

dhanainme avatar Mar 15 '21 17:03 dhanainme

Currently only BODY of the request is passed to the CustomHandler. The URL params of the Model server's inference endpoint are static and not configurable.

Hi dhanainme, Thanks for your reply.

In the end I had to use an nginx proxy (njs script) to translate my calls from GET/URL style to POST/BODY style.... It's very inconvenient, but I had no choices...

neoragex2002 avatar Jul 11 '21 12:07 neoragex2002

Currently only BODY of the request is passed to the CustomHandler. The URL params of the Model server's inference endpoint are static and not configurable.

Hi dhanainme, Thanks for your reply.

In the end I had to use an nginx proxy (njs script) to translate my calls from GET/URL style to POST/BODY style.... It's very inconvenient, but I had no choices...

Hey,bro. How to deal with it. Can you offer a link about this solution

LEONHWH avatar Nov 07 '23 12:11 LEONHWH