{"id":18175,"date":"2020-02-05T08:32:43","date_gmt":"2020-02-05T00:32:43","guid":{"rendered":"http:\/\/4563.org\/?p=18175"},"modified":"2020-02-05T08:32:43","modified_gmt":"2020-02-05T00:32:43","slug":"%e4%b8%80%e4%b8%aapython%e9%87%8cpost%e5%92%8cget%e7%9a%84%e9%97%ae%e9%a2%98%e8%af%b7%e6%95%99%e5%a4%a7%e5%ae%b6%ef%bc%8c%e8%b0%a2%e8%b0%a2","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=18175","title":{"rendered":"\u4e00\u4e2apython\u91ccpost\u548cget\u7684\u95ee\u9898\u8bf7\u6559\u5927\u5bb6\uff0c\u8c22\u8c22"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>\u676f\u5177<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>\u4e00\u4e2apython\u91ccpost\u548cget\u7684\u95ee\u9898\u8bf7\u6559\u5927\u5bb6\uff0c\u8c22\u8c22<\/h3>\n<p>  \t\tdirectadmin\u7684\u5b98\u65b9api\u6709\u8fd9\u6837\u4e00\u6bb5\u8bdd<\/p>\n<p>  special.php<br \/>  You must provide ?lid=1234 as GET for each request, no matter what.<br \/>  Even for POST values, the GET ?lid must always be present. These &#8216;special&#8217; commands require that your account has access to these functions.<\/p>\n<p>  \u4ee5\u4e0b\u662f\u6211\u5199\u7684\u4ee3\u7801\uff1a<\/p>\n<p>  import requests<\/p>\n<p>  uid = &quot;123456&quot;<br \/>  password = &quot;123456&quot;<\/p>\n<p>  def change_license_ip():<br \/>  &nbsp; &nbsp; &quot;\u4fee\u6539\u6388\u6743ip&quot;<br \/>  &nbsp; &nbsp; url = &quot;https:\/\/www.directadmin.com\/clients\/api\/special.php?lid=12345&amp;saveip=1&amp;ip=&quot;<br \/>  &nbsp; &nbsp; ip = input(&quot;\u8bf7\u8f93\u5165\u65b0\u7684\u6388\u6743ip\uff1a&quot;)<br \/>  &nbsp; &nbsp; r = requests.post(url + ip, auth=(uid, password))# \u7528POST\u65b9\u5f0f\u53d1\u9001\u8bf7\u6c42\u5e76\u83b7\u5f97\u54cd\u5e94<br \/>  &nbsp; &nbsp; print(r.text)<\/p>\n<p>  change_license_ip()<\/p>\n<p>  \u4f46\u662fda\u7684api\u8fd4\u56de\u9519\u8bef\u3002\u8bf7\u6559\u4e00\u4e0bphp\u91cc\u53ef\u4ee5\u901a\u8fc7_get[\u53d8\u91cf]\u6765\u4f20\u9012\uff0cpython\u91cc\u5e94\u8be5\u600e\u4e48\u5199\uff1f\u8c22\u8c22\u3002\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>XiaoFaye<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u4f9d\u6211\u7684\u7406\u89e3\u4f60\u4e0a\u9762\u7684\u505a\u6cd5\u662f\u5bf9\u7684\uff0c\u53e6\u5916\u5b83\u8fd4\u56de\u4ec0\u4e48\u9519\u8bef\uff1f\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u676f\u5177 \u5927\u4f6c\u6709\u8bdd\u8bf4 : \u4e00\u4e2apyth&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/18175"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18175"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/18175\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18175"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}