开发者

Removing a line feed from the header in of a c# web request

I need to remove the last line feed from a http webrequest in order to communicate with an json-rpc service. The request which .net generates looks like this.

POST http://localhost.:8332/ HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 4.0.30319.1)
Authorization: Basic dGlwa2c6dGlwa2c=
Host: localhost.:8332
Content-Length: 42
Expect: 100-continue
Connection: Keep-Alive

{"id":1,"method":"getinfo","params":[]}

What I would need would be this (notice the missing line feed after last header value and the begin of the json conte开发者_C百科nt):

POST http://localhost.:8332/ HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 4.0.30319.1)
Authorization: Basic dGlwa2c6dGlwa2c=
Host: localhost.:8332
Content-Length: 42
Expect: 100-continue
Connection: Keep-Alive
{"id":1,"method":"getinfo","params":[]}

I can't find anything where I could manipulate the header which is actually sent to service.

See http://www.bitcoin.org/smf/index.php?topic=2170.0 for more background on the problem...


finally resolved my (core) issue. the problem with my communication with the rpc service, was that I had not set content-type. The service was requiring a content-type of "application/json-rpc" to work properly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜