{"id":400,"date":"2021-09-04T06:38:10","date_gmt":"2021-09-04T06:38:10","guid":{"rendered":"https:\/\/262235.xyz\/?p=400"},"modified":"2021-09-04T06:38:10","modified_gmt":"2021-09-04T06:38:10","slug":"400","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2021\/09\/04\/400\/","title":{"rendered":"python requests \u5e93\u5b66\u4e60"},"content":{"rendered":"<ul>\n<li>Python\u6700\u5e38\u7528\u6293\u7f51\u9875\u5e93-<a href=\"https:\/\/www.lyvba.com\/index.php\/archives\/245\/\">Requests<\/a><\/li>\n<\/ul>\n<pre><code>import requests\ndef  text():\n    url = 'https:\/\/lyvba.com\/gettime.php'\n    r = requests.get(url)\n    print(r.text)\n\ndef  headers():\n    url = 'https:\/\/lyvba.com'\n    r = requests.get(url)\n    print(r.headers)\n\ndef  content():\n    url = 'https:\/\/lyvba.com\/logo\/262235.png'\n    r = requests.get(url)\n    print(r.content)\n\ndef  savepng():\n    url = 'https:\/\/lyvba.com\/logo\/262235.png'\n    r = requests.get(url)\n    with open('logo.png', mode='wb') as file:\n        file.write(r.content)\n\ndef  save7zip():\n    url = 'https:\/\/lyvba.com\/linux-command\/linux-command.7z'\n    r = requests.get(url)\n    with open('linux-command.7z', mode='wb') as file:\n        file.write(r.content)\n\ntext()\nheaders()\n# content()\n# savepng()\n# save7zip()\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Python\u6700\u5e38\u7528\u6293\u7f51\u9875\u5e93-Requests import requests def text(): [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[45],"class_list":["post-400","post","type-post","status-publish","format-standard","hentry","category-learn","tag-python"],"_links":{"self":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/400","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/comments?post=400"}],"version-history":[{"count":0,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/400\/revisions"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=400"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=400"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=400"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}