سؤال

Quick question: need pure python script of simple http client without using libs (only socket library possible).

Main task of this client is connect to server, receive greetings, sends get requests and read responses. Also it's good if this code will be compatible with Cython compiler.

هل كانت مفيدة؟

المحلول

I would recommend you using requests https://github.com/kennethreitz/requests package.

But your question looks like an assignment which shall teach you how is http working on TCP communication level. In such case I would recommend you

  • learn using http protocol over telnet or netcat
  • then learn TCP communication by Python and repeat, what you already know by telnet
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top