Skip to content

Unclear backtick behaviour with escape characters #4621

@CHPmyver

Description

@CHPmyver

I have a number of tests that I run, where the body of POST requests must be byte for byte fixed when I run them, since an HMAC is applied across the body, for integrity and webhook authentication.

For this I have been using the single backtick Oneline string body for the POST payloads. But it is not clear to me whether escape characters are allowed here? The documentation does not seem to go into this.

Based on previous experience with other 'verbatim string' constructs, I would expect the following test to pass:

POST https://httpbin.io/post
content-type: text/plain
`Backticks and ...\nbackslashes`
HTTP 200
[Asserts]
jsonpath "$.data" == "Backticks and ...\\nbackslashes"

In other words: the \n does not become a newline character.

But instead it outputs the string:

Backticks and ...
backslashes

Is this intended behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions