English 中文(简体)
如何“直接”在沙里执行吉大港山区邮政局
原标题:How to Perform a HTTP Post "directly" in Python

我对吉大港山区与吉大港山区邮政局之间的差别不甚了解,因此,我希望从当时更了解情况的人那里获得一些信息。

我写了以下法典:

<form action="https://na.leagueoflegends.com/user/login" method="post">
    <input name="name" type="text" value="MYACCOUNTLOGINUSERNAME">
    <input name="pass" type="password" value="PASSWORD">
    <input name="form_id" id="edit-user-login" value="user_login">
    <input class="login_button" value="Submit" type="submit" style="width:100px">            
</form>

当我把我的实际用户名和密码带上表格并点击提交名单I时,将适当登录在网站上。

然而,当我从POST改用到GET时,它返回了以下几个方面:

我的问题是,在我不必创建一种表格的情况下,能否通过“直接的”POST来做,而我只能开一个包含在我身上和投向服务器的恰当参数的URL?

事先感谢你的知识、建议和/或回答。

最佳回答

基本是指接受 co。 在寄出一份POST申请后,请你获得一个证明你今后申请GET的 co。 但是,除非服务器方面允许,GET申请不能认证你(因为其住房非常不安全,不允许提供住房)。 因此,对你的回答是“不可能、不可能”。

把 co子插入真正的浏览器并不容易。 我建议你使用<条码>机械化,如果你想要使日志过程自动化,则不自动使用。 如果您想将其他物品自动化,并查看urllib2<>/code>或,以便吉大港定居人士协会提出良好的申请。

问题回答

The most sophisticated library to use for this purpose is probably requests

>>> import requests
>>> response = requests.post(... your args here ...)

参看requests.post





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...