cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying HTTP Request headers from an incoming request in a REST mock server

SOLVED
Highlighted
Frequent Visitor

Displaying HTTP Request headers from an incoming request in a REST mock server

I have created a REST Mock Service in soapUI. When the server processes the incoming REST-HTTP requests from my (test) application, I want to be able to view these incoming requests - all the HTTP headers and possible payload.

Is this possible? I don't see an option I can select to achieve this.

Any help would be appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Frequent Contributor

Re: Displaying HTTP Request headers from an incoming request in a REST mock server

Mocks can be dynamic or static, they default to returning a static result, however you can control the response with groovy.

 

Select the resource on the mock:

 

image.png

Change SEQUENCE to SCRIPT to make it a dynamic mock.

image.png

You can now edit the Groovy script, this is how the mock can provide different responses to different test requests. You can examine the content including headers with Groovy.

 

You can read more at : https://www.soapui.org/soap-mocking/creating-dynamic-mockservices.html

1 REPLY 1
Frequent Contributor

Re: Displaying HTTP Request headers from an incoming request in a REST mock server

Mocks can be dynamic or static, they default to returning a static result, however you can control the response with groovy.

 

Select the resource on the mock:

 

image.png

Change SEQUENCE to SCRIPT to make it a dynamic mock.

image.png

You can now edit the Groovy script, this is how the mock can provide different responses to different test requests. You can examine the content including headers with Groovy.

 

You can read more at : https://www.soapui.org/soap-mocking/creating-dynamic-mockservices.html