rfortune
16 years agoContributor
Empty TEMPLATE in resource endpoint causes request to fail
Hi there
I have a generic endpoint that I'm writing tests against: http://api-proxy.web/api.xro/2.0/{endpoint}/{ID}
I defined the base of the endpoint in my Service Endpoints section. I then defined a parameterized resource path as follows:
api.xro/2.0/{endPoint}/{ID}
The idea being that I can have generic methods against a URL and then specify the final endpoint in the test.
When I use the above setup it works fine so long as I provide data for each of the Templates e.g. {endpoint} and {ID}
However ID is optional and only used when I am looking for a specific item, in this case an invoice.
If I leave the {ID} Template blank it the request fails to generate correctly and appears as the following in the Raw view:
"GET null HTTP/1.1"
Where as if the ID Template is provided the request forms perfectly:
"GET http://api-proxy.web/api.xro/2.0/Journa ... e5b66f0abb"
Is there a work around or a way for me to meet my goals? Rather than supplying the item ID as a Template, is there an optional way of passing in such a parameter?
I have a generic endpoint that I'm writing tests against: http://api-proxy.web/api.xro/2.0/{endpoint}/{ID}
I defined the base of the endpoint in my Service Endpoints section. I then defined a parameterized resource path as follows:
api.xro/2.0/{endPoint}/{ID}
The idea being that I can have generic methods against a URL and then specify the final endpoint in the test.
When I use the above setup it works fine so long as I provide data for each of the Templates e.g. {endpoint} and {ID}
However ID is optional and only used when I am looking for a specific item, in this case an invoice.
If I leave the {ID} Template blank it the request fails to generate correctly and appears as the following in the Raw view:
"GET null HTTP/1.1"
Where as if the ID Template is provided the request forms perfectly:
"GET http://api-proxy.web/api.xro/2.0/Journa ... e5b66f0abb"
Is there a work around or a way for me to meet my goals? Rather than supplying the item ID as a Template, is there an optional way of passing in such a parameter?