python socket发http GET请求数据包
来源:互联网 发布:mysql添加外键 编辑:程序博客网 时间:2024/06/06 04:36
#! /usr/bin/env python# coding=utf8import socketimport argparseimport sysdef main(): parser = argparse.ArgumentParser(description="socket test") parser.add_argument('--host', action="store", dest="host", required=True) parser.add_argument('--port', action='store', dest='port', type=int, required=True) give_args = parser.parse_args() host = give_args.host port = give_args.port try: s= socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(200) except socket.error as e: print 'Error create socket %s'.format(e) try: s.connect((host,port)) except Exception as e: print 'Connect %s error'.format(e) try: s.sendall('GET /lntu/pub_message/message.jsp?fmodulecode=5100&modulecode=5100&messageid=35837 HTTP/1.0\r\n\r\n') except socket.error as e: print 'Send %s'.format(e) while True: try: buf = s.recv(2048) print buf break except socket.error as e: print eif __name__ == "__main__": main()
0 0
- python socket发http GET请求数据包
- 使用Socket发HTTP GET请求
- [python] 发GET请求
- Python发一个GET请求
- python socket get http
- python socket模拟一个http Get请求页面
- SOCKET模仿HTTP GET请求
- Python发get和post请求
- python发送HTTP GET请求
- python发送HTTP GET请求
- Python发送HTTP GET请求
- Python - Http Get Post请求
- Python实现HTTP GET请求
- 使用socket发送http请求(GET/POST)
- 使用socket发送http请求(GET/POST)
- socket编程实现http GET请求
- 使用socket发送http请求(GET/POST)
- 通过Socket实现Http中Get请求
- MyBatis Generator生成sqlMap、DAO、mo
- 用批处理对MySQL进行数据操作
- 级联菜单,两级菜单
- NoHttp实践
- TransitionDrawable使用以及动画效果
- python socket发http GET请求数据包
- IntentService 源码分析
- <script type="text/javascript">alert("hello world");</script>
- Android常用权限
- 玩玩负载均衡---在window与linux下配置nginx
- 第16周 阅读程序 4
- canvas
- Java程序获得本机的ip+tomcat端口等
- LoadRunner支持的IE版本