zoukankan      html  css  js  c++  java
  • post get 请求 headers注释哪些

    1. post和get
      #post请求
      fomdata=urllib.parse.urlencode(fomdata).encode() request=urllib.request.Request(url=url,headers=headers) response=urllib.request.urlopen(request,fomdata) print(response.read().decode()) #get请求 formdata=urllib.parse.urlencode(formdata) url=url+formdata request=urllib.request.Request(url=url,headers=headers) response=urllib.request.urlopen(request) print(response.read().decode())
    2. headers
      headers={
      # ':authority': 'fanyi.baidu.com',
      # ':method':'POST' ,
      # ':path': '/v2transapi',
      # ':scheme': 'https',
      # 'accept':' */*',
      # 'accept-encoding': 'gzip, deflate, br',
      'accept-language': 'en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7',
      # content-length: 120
      'content-type':'application/x-www-form-urlencoded; charset=UTF-8',
      'cookie': 'BIDUPSID=344E96ED3E73C19886D2399AFC06F786; PSTM=1569325908; BDRCVFR[PaHiFN6tims]=9xWipS8B-FspA7EnHc1QhPEUf; delPer=0; H_PS_PSSID=; BAIDUID=7010B62BC424CB7AA40287983B9D0215:FG=1; to_lang_often=%5B%7B%22value%22%3A%22en%22%2C%22text%22%3A%22%u82F1%u8BED%22%7D%2C%7B%22value%22%3A%22zh%22%2C%22text%22%3A%22%u4E2D%u6587%22%7D%5D; REALTIME_TRANS_SWITCH=1; FANYI_WORD_SWITCH=1; HISTORY_SWITCH=1; SOUND_SPD_SWITCH=1; SOUND_PREFER_SWITCH=1; locale=zh; from_lang_often=%5B%7B%22value%22%3A%22zh%22%2C%22text%22%3A%22%u4E2D%u6587%22%7D%2C%7B%22value%22%3A%22en%22%2C%22text%22%3A%22%u82F1%u8BED%22%7D%5D; BDRCVFR[L_O2j-KLwCb]=9xWipS8B-FspA7EnHc1QhPEUf; PSINO=7; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; Hm_lvt_64ecd82404c51e03dc91cb9e8c025574=1569325935,1569325981,1569326164,1569327273; Hm_lpvt_64ecd82404c51e03dc91cb9e8c025574=1569327273; __yjsv5_shitong=1.0_7_2ba691681ef2bf8fe83cac2ac05d6d7b920e_300_1569327272977_120.192.27.116_b8b27433; yjs_js_security_passport=597fd813e841914fb2438ff168e087a634ead1a1_1569327273_js',
      'origin': 'https://fanyi.baidu.com',
      'referer': 'https://fanyi.baidu.com/?aldtype=16047',
      'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36',
      # 'x-requested-with': 'XMLHttpRequest',
      }
  • 相关阅读:
    Hexo Daemon
    Eclipse远程Debug
    IT人都欠自已一个Lable Page
    Linux下java/bin目录下的命令集合
    python笔记--5--文件操作
    python笔记--4--面向对象
    python笔记--3--函数、生成器、装饰器、函数嵌套定义、函数柯里化
    python笔记--1--基础知识、数据类型
    Django笔记--视图
    C++笔记--1
  • 原文地址:https://www.cnblogs.com/ybl20000418/p/11581280.html
Copyright © 2011-2022 走看看