Campoie / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

Http Post: Encoding issue for body(RequestSpecification) with utf-8 charset. #132

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. When we send to the following utf-8 character string "5021 sŠmmŽns 
br€nch tr€Šl" in the body of request this is getting transformed into 
"5021 sŠmmŽns br€nch +"(Please note business logic in our side 
truncate the string longer than 25 characters with +)
2.
3.

What is the expected output? What do you see instead?
expected to preserve the charset. Instead string in request("5021 sŠmmŽns 
br€nch tr€Šl") is changed to "5021 sÅ mmŽns br€nch +"(Please note 
business logic in our side truncate the string longer than 25 characters with +)

What version of the product are you using? On what operating system?
1.4 on Ubuntu 10.04.3 LTS

Please provide any additional information below.

Code Snippet
The request string orderRequestXmlString contains the above utf-8 string "5021 
sŠmmŽns br€nch tr€Šl"

String OrderResponse = RestAssured().given().header("Content-Type", 
"application/xml")
 .body(orderRequestXmlString.getBytes("UTF8")).then().expect().statusCode(200)
    .when()
    .post(EOS_URL + "order").asString();

Original issue reported on code.google.com by ad...@thevara.com on 2 Nov 2011 at 7:24

GoogleCodeExporter commented 9 years ago
Hi, 

I'm working hard on releasing version 1.5 pretty soon and if you find this 
urgent perhaps you could help out by creating a patch or investigate what in 
the code that causes this behavior. Also just to make sure, are you certain 
that it's REST Assured that causes this and not something else? (this would 
help to save me a lot of time if I need to look into it).

Original comment by johan.ha...@gmail.com on 3 Nov 2011 at 6:54

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 24 Jan 2012 at 9:02

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 31 Jan 2012 at 7:58