【问题标题】:How to make post request to Content-Type text/x-gwt-rpc; charset=utf-8如何向 Content-Type text/x-gwt-rpc 发出 post 请求;字符集=utf-8
【发布时间】:2018-03-22 14:26:18
【问题描述】:

我是python的初学者。我想解析一个网站,但标题显示内容类型text/x-gwt-rpc; charset=utf-8 和请求有效负载...

7|0|4|https://kekeke.cc/com.liquable.hiroba.home.gwt.HomeModule/|53263EDF7F9313FDD5BD38B49D3A7A77|com.liquable.hiroba.gwt.client.square.IGwtSquareService|getNoOfCrowd|1|2|3|4|0|

请求:

POST /com.liquable.hiroba.gwt.server.GWTHandler/squareService HTTP/1.1
Host: kekeke.cc
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0
Accept: */*
Accept-Language: zh-TW,zh;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: https://kekeke.cc/
Content-Type: text/x-gwt-rpc; charset=utf-8
X-GWT-Permutation: 8F22796231EB8C8312C5D1BB10451262
X-GWT-Module-Base: https://kekeke.cc/com.liquable.hiroba.home.gwt.HomeModule/
Content-Length: 177
DNT: 1
Connection: keep-alive

谁能告诉我如何在 python 中发出 post 请求?

【问题讨论】:

    标签: python


    【解决方案1】:

    我找到了解决方案。可以通过简单地使用 r = requests.post(url, "7|0|4|https://kekeke.cc/com.liquable.hiroba.home.gwt.HomeModule/|53263EDF7F9313FDD5BD38B49D3A7A77|com.liquable.hiroba.gwt.client.square.IGwtSquareService|getNoOfCrowd|1|2|3|4|0|", headers=headers) 来解决。在许多在线教程中,他们通过使用 {data:data} 形式的数据来教授发布请求,以仅提交发布请求。但是,在某些情况下,可以通过以字符串的形式提交数据来完成。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-05-28
      • 1970-01-01
      • 2012-09-18
      • 1970-01-01
      • 2015-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多