cancel
Showing results for 
Search instead for 
Did you mean: 

How to return HTTP status code without description?

Highlighted
Visitor

How to return HTTP status code without description?

Hello everybody,

I try to verify a reason for an error . For this I use a mock service and send responses.

What I get is an response starting with...

 

HTTP/1.1 202 Accepted

 

What I need is a response starting with ...

HTTP/1.1 202

... without "Accepted"

Is ther a chance to get a message like this?

 

Thanks in advance!

1 REPLY 1
Highlighted
Community Hero

Re: How to return HTTP status code without description?

You can do this by setting up your own MockResult in the OnRequest script for the MockService.

 

if (mockRequest.httpRequest.method == 'PUT' && mockRequest.path == '/doMyUpdatePlease') {

mockRequest.httpResponse.setStatus(202, "") // empty Reason Phrase
return new com.eviware.soapui.impl.rest.mock.RestMockResult(mockRequest)

}

In this case, you don't need to add a MockResponse to your MockService as these requests will be handled completely by the script.

New Here?
Join us and watch the welcome video:
Top Kudoed Authors