Skip to Content
可编程网络自动化
book

可编程网络自动化

by Jason Edelman, Scott S. Lowe, Matt Oswalt
January 2023
Intermediate to advanced
458 pages
14h 16m
Chinese
Posts & Telecom Press
Content preview from 可编程网络自动化
使用网络
API
157
下面先从深入研究基于
HTTP
API
开始。
7.1.1
 熟悉基于
HTTP
API
在网络
API
的背景下,需要了解两种基于
HTTP
API
,它们分别是基于
HTTP
RESTful API
和基于
HTTP
的非
RESTful API
。为了更好地理解它们以及术语
RESTful
的含
,本节将从理解
RESTful API
开始
。弄明白了
RESTful
架构和原则之后,我们会继续将
其与基于
HTTP
的非
RESTful API
进行比较。
1.
理解
RESTful API
RESTful
API
在网络行业中日渐流行
,使用也越来越普遍
,尽管其在
2000
年年初就已经出
现了。如今存在于网络基础设施中的大多数
API
是基于
HTTP
RESTful API
。这意味着
当你听说网络设备或
SDN
控制器上的
RESTful API
时,指的就是可用于客户端和服务器之
间通信的
API
客户端可以是应用程序(比如
Python
脚本或
Web UI
应用程序)
,服务器可以是网络设备
或控制器。而且,由于
HTTP
被作为传输之用,因此可以使用
URL
执行某些操作
,就像
浏览万维网时所做的那样。因此,如果知道在浏览网站时要执行
HTTP GET
,在填写表单
并单击提交时要执行
HTTP POST
,那么你就已经具备了使用
RESTful
API
的基础知识。
来看一下从网站检索数据以及通过
RESTful API
从网络设备检索数据的示例
。在这两种情
况下,都会向
Web
服务器发送
HTTP
GET
请求,如图
7-1
所示。
HTML
响应
HTTP GET
HTTP ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

弱监督学习实用指南

弱监督学习实用指南

Wee Hyong Tok, Amit Bahree, Senja Filipi
Python和NLTK实现自然语言处理

Python和NLTK实现自然语言处理

Posts & Telecom Press, Nitin Hardeniya
Go程序设计语言

Go程序设计语言

艾伦A. A.多诺万, 布莱恩W. 柯尼汉
Python机器学习案例精解

Python机器学习案例精解

Posts & Telecom Press, Yuxi (Hayden) Liu

Publisher Resources

ISBN: 9787115606181