Contributions
Disable response compression for VirtServer
Hello, There is a http configuration "Accept compressed responses from hosts" within ReadyAPI, is there a similar configuration for VirtServer? Our company has this configuration disabled in ReadyAPI (the box is unchecked), as our application needs the response in full/uncompressed and the content-length http header. However, VirtServer doesn't seem to honor this config when it's disabled (not sure how it would since this config appears to be more client based). Is there a way to disable this configuration for a virtual service that is deployed and managed by VirtServer? This is blocking our ability to use our virtual service. Any insight is appreciated.605Views0likes0CommentsRe: Route request but return mocked response
I found a solution and sharing here incase anyone has the same issue. I simply send a request to the actual service using groovy, and have the groovy logic for this executed before the Routing logic. You can use event handlers for this code snippet but I've placed it along the Routing script box for better visibility. def get = new URL("Your 'Route to' host here" + mockRequest.path) conn = get.openConnection(); conn.requestMethod = 'GET' def headers = mockRequest.getRequestHeaders() conn.setRequestProperty("session_token", headers.get('session_token')[0]) conn.getResponseCode(); Thanks all for the help.3 years agoPlace ReadyAPI QuestionsReadyAPI Questions953Views1like0CommentsRe: Route request but return mocked response
>So you have an endpoint you want to hit which will give you a perfectly valid response, but instead of the expected, valid response, you want to stub the response to be something different? Correct! There is some backend logic that gets triggered and invoked whenever the endpoint gets called. I need this logic to be triggered in order to proceed in a workflow I am testing. I don't need the actual response that is returned from the actual service though. I'll be using a mocked response (which is different from what the actual service returns, the response itself is a bunch of configuration data the UI consumes that drives certain UI behavior, I'm testing a different set of configuration than what the actual service usually returns).3 years agoPlace ReadyAPI QuestionsReadyAPI Questions991Views0likes2CommentsRoute request but return mocked response
I have a request that needs to be routed to the actual live api because the api invokes some backend logic needed to continue a workflow. However, I would still like to return a mocked response. Is there a straight forward way to have the request still be routed but return a mocked response?1KViews0likes5CommentsRe: Virtual Service - Conditional Routing based on request data and database lookup
Thanks for the response. In my case, it is a REST Service, there are instances in which parameters are used, however none of which are adequate for the routing logic. I'd like to avoid reaching the Dispatch stage unless there is a way to re-route the request to the actual service instead of using a mocked response. I have many apis in which they only identifier is a random string that needs a mapping to a database value in order to determine to route or not.3 years agoPlace ReadyAPI QuestionsReadyAPI Questions816Views0likes0CommentsVirtual Service - Conditional Routing based on request data and database lookup
For ReadyAPI Virtual Service, Is there a way to route based on the value of a database query (augmented with some request value)? I have a request with no static identifier, the only identifier is a guid (a random string of alpha numeric characters). I would like to perform a database look up on what user/value this guid maps to and then decide to route it or not. I know there is database sources, however most documentation cites datasources for use in the response. Any insight is appreciated. Thanks!833Views0likes2Comments