开发者

Is using HTTP 1.0 bad practice?

I'm implementing a basic http client for communicating with a web service and am wondering if I should go with http 1.0 or 1.1. The data section will consist of binary data and the remote server will always be controlled by me (running IIS7.5). The firewalls / proxies inbetween is nothing I'm controlling, ie. the packets must not be stopped if wrong http version is used.

I've been reading up about the difference between http 1.0 and 1.1 and it seems to me t开发者_C百科hat http 1.0 supports everything I need.

Will I encounter problems if i choose http 1.0 over 1.1 or can I assume that everything will work just as good?

What makes me wonder is that if I connect via raw sockets to IIS7.5 and send a http 1.0 get request, the response is always http 1.1.


A firewall certainly will not block it and a router will route it.

I would suggest using HTTP 1.1. Chances are nothing will be affected if you use HTTP 1.0. However, you never know who else might use your HTTP client in the future and what horrible server implementation it will be used with.

You also need to ask yourself why you are implementing an HTTP client in the first place. Why not just use a standard library? I do not know what language you are using, but libcurl has bindings for many languages.

You can see more about libcurl here.


I don't think there's anything wrong using 1.0 as a client, most web servers are backward compatible.

If you're really have concerns, send 1.1 and only deal with stuff you want to handle, I don't think there's anything possibly go wrong choose either case.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜