栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

HTTP and Flask Basics - Introduction to Curl and Chrome Dev Tools

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

HTTP and Flask Basics - Introduction to Curl and Chrome Dev Tools

Chrome Dev Tools
If you want to check how your requests are being sent, and what the responses are from the browser, you can do so using Chrome Dev Tools. There are numerous tools within it, but the key area you will use is the Network tab.


Curl

Curl is a library and command-line tool that completes IP transfers of data using URLs. One quick way to test your API while your API server is running is to run a curl command in another terminal window.

Curl syntax

$ curl -X POST http://www.example.com/tasks/

The above is a sample curl request. Every request starts off with the command curl and needs to include a URL. Other parts you see added in are options that you can use to build your request. In the example, the -X shortform option (also –request) specifies the request method.


Curl Options
You can find more options by entering the following command in the terminal:

$ curl --help

Try piping the output to the jq, a command-line JSON processor, as shown below:

$ curl https://example/test | jq '.'

如果在Terminal显示不了,可以用这个网站来看JSON result
查询curl结果

Art of scripting HTTP Requests Using Curl

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/688650.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号