AnsweredAssumed Answered

Can We Match on Request Meta Data?

Question asked by jeff.wallace on Aug 23, 2016
Latest reply on Aug 30, 2016 by Melanie_Giuliani

I am working with a REST service and DevTest 9.0.

 

The REST call looks very similar to this ::

GET /instance/0123-456-789/

 

This REST call will return a different payload based on the "User-Agent" key-value pair passed in the request meta data.

 

For example ::

If the request Meta Data "User-Agent" is equal to "ruby-openid/2.7.0 (x86_64-linux)"

Then the REST service will send back an XML payload in the response.

 

If the request Meta Data "User-Agent" is equal to "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"

Then the REST service will send back an HTML payload in the response.

 

 

Question ::

Is there a way that I can return either the XML payload, or the HTML payload, depending on what "User-Agent" value was received in the request Meta Data?

Outcomes