question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Return same request body

See original GitHub issue

Hello, In the response.body I want to return the same request.body For that I use the transformer but it transforms quotes too. Here is an example:

{
  "Request": {
    "Path": {
      "Matchers": [
        {
          "Name": "WildcardMatcher",
          "Pattern": "/test"
        }
      ]
    },
    "Methods": [
      "post"
    ]
  },
  "Response": {
    "StatusCode": 300,
    
    "Body": "{{request.body}}",
    "UseTransformer": true
  }
}

When I test with

{
  "key":"value"
}

I get

{
  "key":"value"
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
StefHcommented, Nov 30, 2019

1] Use the triple-stash syntax: {{{request.body}}} --> https://github.com/rexm/Handlebars.Net/issues/55

2] Try new preview NuGet: WireMock.Net.1.0.38-ci-12259.nupkg

0reactions
StefHcommented, Dec 26, 2019

PR merged to master.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I return the request body in a POST request?
1 Answer. It return a python dictionary, if the request passed a json formatted body, otherwise check what you request is sending.
Read more >
RESTful API. Should I be returning the object that was ...
It is OK (and most likely desirable) to return something in a POST/PUT response body. How this is done is application-specific and almost ......
Read more >
Request Body - FastAPI
A request body is data sent by the client to your API. A response body is the data your API sends to the...
Read more >
Spring's RequestBody and ResponseBody Annotations
The @ResponseBody annotation tells a controller that the object returned is automatically serialized into JSON and passed back into the ...
Read more >
Mock responses that include request body
I took them directly from Swagger and they are valid responses according to my schema. Now I'm trying to send a POST request...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found