headzoo / surf

Stateful programmatic web browsing in Go.
MIT License
1.49k stars 160 forks source link

Add body to arguments of buildRequest(). #1

Closed haruyama closed 10 years ago

haruyama commented 10 years ago

Some web servers require Content-Length Header for POST requests. We should set http.Request.ContentLength field properly.

When we set Request.Body manually, we should set Request.ContentLength manually too.

http.NewRequest() sets ContentLength field automatically, so we may use it.

headzoo commented 10 years ago

Thanks. Once I have a minute to quickly test this I'll tag a new release.