HTTP EndPoints Data Within Route URL

Hi,

I just started playing with MongoDB API (Never knew about it) and it is pretty impressive for a small app project I am working on. I am struggling on a slight issue though which I cannot find any manual for (or maybe my search skills are bad).

I have created 3 GET endpoints and some functions these all work well and tested via postman. However since coming from .Net and Web API one issue which bugs me and something which I’d like to keep so I don’t need to change my APP URLS is have the querystring data within the URL.

Currently the route ends points are like so:

myapi.com/endpoint/method/?query=value

I would prefer

myapi.com/endpoint/method/name/value

Essentially having the query data with the URL route, is this possible to achieve? it would save my time as I would not need to change how my app functions.

Hi @asim welcome to the community!

I just started playing with MongoDB API

I’m a bit unclear on this: do you mean Data API or is it something else?

I have created 3 GET endpoints and some functions these all work well and tested via postman. However since coming from .Net and Web API one issue which bugs me and something which I’d like to keep so I don’t need to change my APP URLS is have the querystring data within the URL.

How did you create the GET endpoints? I apologize in advance if I’m presuming too much, but the GET endpoint designs are not ones I’m familiar with from the MongoDB side, so I’m guessing this is created using a framework?

Could you share more information regarding the framework you’re using and the MongoDB product you’re having trouble with?

Best regards
Kevin

1 Like