1

I have a stub file that i'm sending via the c# admin api to a standalone wiremock instance. I'm getting the expected response back when i send via postman except the response body is always empty, even though in my file i have this:

"Response": {
"Delay": 500,
"UseTransformer": true,
"StatusCode": 205,
"BodyAsJson": { "result": "PRIO = 1 . test" },
"Headers": {
  "Content-Type": "application/json",
  "a": "b"
}

}

I see the expected header a b but nothing in the body. Also if i change it to be plain text:

"Response": {
"Delay": 500,
"UseTransformer": true,
"StatusCode": 205,
"body": "Hello world!",
"Headers": {
  "Content-Type": "application/text",
  "a": "b"
}

This doesn't work either - what am i doing wrong ?

auburg
  • 1,373
  • 2
  • 12
  • 22

2 Answers2

0

It is hard to say looking at the data you have provided what request are you exactly sending to the standalone Wiremock.

The way to investigate the issue would be to hit the get all mappings endpoint in Wiremock /__admin/mappings and check in the response that what you have sent is what is primed in Wiremock.

Wojtek
  • 1,410
  • 2
  • 16
  • 31
0

Could it be that HTTP 205 does not allow you to return a body? So can you try HTTP 200 ?

See also https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

10.2.6 205 Reset Content

The server has fulfilled the request and the user agent SHOULD reset the document view which caused the request to be sent. This response is primarily intended to allow input for actions to take place via user input, followed by a clearing of the form in which the input is given so that the user can easily initiate another input action. The response MUST NOT include an entity.

Stef Heyenrath
  • 9,335
  • 12
  • 66
  • 121