# Http.post dropping trailing '}'

**URL:** <https://www.ruby-forum.com/t/http-post-dropping-trailing/90344>\
**Category:** Ruby\
**Created:** [March 28, 2007, 1:03am UTC](https://www.ruby-forum.com/t/http-post-dropping-trailing/90344 "2007-03-28T01:03:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![femeref](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/90ced4/32.png) [@femeref](https://www.ruby-forum.com/u/femeref)\
**Post date:** [March 28, 2007, 1:03am UTC](https://www.ruby-forum.com/t/http-post-dropping-trailing/90344/1 "2007-03-28T01:03:58Z")

</div>

I am making a call through http.post in Ruby 1.8.5.

uri = …  
data = ‘{}’  
headers = …  
http.post(uri, data, headers)

Everything seems to work except that the trailing ‘}’ in data is not  
getting posted, as determined by the network analyzer WireShark. My  
entire posted data is just ‘{’. Is there some sort of sanitization or  
choping that I am unaware of?

Thanks.

---

<div class="post-metadata">

**Author:** ![femeref](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/90ced4/32.png) [@femeref](https://www.ruby-forum.com/u/femeref)\
**Post date:** [March 28, 2007, 1:29am UTC](https://www.ruby-forum.com/t/http-post-dropping-trailing/90344/2 "2007-03-28T01:29:30Z")

</div>

Wilson Chen wrote:

> choping that I am unaware of?  
> you could either try String#dump to automagically create escape  
> characters, or escape the {} yourself with a backslash.

I have no clue, though, if that is feasible in regard to the receiving  
end.

–  
Phillip “CynicalRyan” Gawlowski

Rule of Open-Source Programming #11:

When a developer says he will work on something, he or she means  
“maybe”.

---

<div class="post-metadata">

**Author:** ![femeref](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/90ced4/32.png) [@femeref](https://www.ruby-forum.com/u/femeref)\
**Post date:** [March 28, 2007, 9:34pm UTC](https://www.ruby-forum.com/t/http-post-dropping-trailing/90344/3 "2007-03-28T21:34:23Z")

</div>

On Wed, Mar 28, 2007 at 08:04:00AM +0900, Wilson Chen wrote:

> choping that I am unaware of?  
> Attached is a test case which proves everything is working OK, for me  
> anyway:

$ ruby posttest.rb  
Listening on port 38449  
\<\< request \>\>  
POST /foo/bar HTTP/1.1  
Accept: _/_  
Content-Type: text/plain  
Content-Length: 2  
Host: 127.0.0.1:38449

\<\< end headers \>\>  
“{}”  
Response: #\<Net::HTTPServerError 500 Go away readbody=true\>

This is ruby 1.8.4 (2005-12-24) [i486-linux] under Ubuntu 6.06

So I think you’re probably misinterpreting your wireshark output, in  
which  
case maybe you should post it. Better still, post tcpdump -s0 -X -n  
output.

Regards,

Brian.
