Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
book
Python语言及其应用(第2版)
by
Bill Lubanovic
March 2022
Intermediate to advanced
522 pages
13h 52m
Chinese
Posts & Telecom Press
Content preview from
Python语言及其应用(第2版)
Web
|
339
18.6
Web API
和
REST
数据通常只在
Web
页面内可用。如果想访问数据,就需要通过
Web
浏览器访问页面并读
取它。如果网站作者在你访问后修改了页面,则数据位置和样式可能会发生改变。
你可以通过
Web
应用编程接口提供数据
,而不是发布网页。客户端通过向
URL
发出请求
来访问你提供的服务,并获取包含状态和数据的响应。数据不再采用
HTML
页面
,而是采
用更易于程序使用的格式,比如
JSON
或
XML
(有关这些格式的更多信息,参见第
16
章
)。
表述性状态转换
(
representational state transfer
,
REST
)是由
Roy Fielding
在其博士论文中
提出的
。很多产品声称自己具备
REST
接口或
RESTful
接口。而实际上
,这往往只是说这
些产品有
Web
接口,可以通过
URL
访问
We
b
服务。
RESTful
服务会以特定方式使用
HTTP
动词。
•
HEAD
可以获取资源的信息,但不包括其数据。
•
GET
会从服务器检索资源数据。这是浏览器所使用的标准方法。
GET
不应该用于创建、
修改或删除数据。
•
POST
会创建新资源。
•
PUT
会替换已有资源,如果不存在,就创建新资源。
•
PATCH
会部分更新资源。
•
DELETE
会删除资源。就像广告中的真话一样!
4
RESTful
客户端也可以使用
HTTP
请求头部向服务器请求一种或多种内容类型。例如,带
有
REST
接口的复杂服务可能更喜欢使用
JSON
字符串作为输入和输出。
18.7
爬取数据
有时候,你可能想要一些电影评级、股票价格或者产品可用性的信息 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial
You might also like
Python编程入门与实战
Posts & Telecom Press, Fabrizio Romano
Python实用技能学习指南
Posts & Telecom Press, Robert Smallshire, Austin Bingham
Python技术基础视频教程
保罗·J·戴特尔
Python面向对象编程指南
Posts & Telecom Press, Steven F. Lott
Publisher Resources
ISBN: 9787115586223