Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backslash in json #1009

Open
bearxc opened this issue May 6, 2018 · 1 comment
Open

backslash in json #1009

bearxc opened this issue May 6, 2018 · 1 comment

Comments

@bearxc
Copy link

bearxc commented May 6, 2018

I need contain single backslash in json info ,

JSONObject sample = new JSONObject();
sample.put("key","\\/abc");

response = given()
            .body(sample.toString())
            .when().post(postUrl);

I checked request body , it still sends out double backslash.

is it possible to just send single backslash ?

@johanhaleby
Copy link
Collaborator

Hmm try sending the data as a map instead:

var hashMap = new HashMap<String, String>();
hashMap.put("key", "\\/abc");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants