i have a rest API that is a front end to a more complex SOAP based service. The soap based service uses extended(custom) WSA-addressing headers in order to perform its routing. The extension of the WSA-Addressing adds two header parameters country and city for example. Since the routing elements are mandatory I need to pass them in some form to the REST API and then use them on the SOAP client in order to get the routing right. I have two options with regards of the REST API:
- Pass them as HTTP headers
- Pass them as path parameters. Lets say that for example the two routing parameters are land and city and my REST resource ID is 123456.
them my GET will look like:
getResource/country/city/123456
If I use headers then it will be:
getResourfce/123456
It should be noted that the ID alone is uniquly identifying a resource , so the country and city are for routing only.
If I was using SOAP there would have been no question that I will use HEADERs. What is the situation when REST is used with regards of routing.
What is the proper way of expressing this parameters ? Headers or path elements ?
path
to the resource is typically$collection/$specific?$filter
, e.g./products/shoes?brand=Nike
. – Thomas Junk Dec 10 '19 at 20:17country
andcity
are required. – Dan Wilson Dec 10 '19 at 20:29