curl 指令

news2025/2/28 17:05:35

勿以恶小而为之,勿以善小而不为---- 刘备

curl 是常用的命令行工具,用来请求 Web 服务器。
它的名字就是客户端(client)的 URL 工具的意思。
它的功能非常强大,命令行参数多达几十种

我们后端开发者, 可以在用户环境上没有 Postman, ApiFox 这样的请求工具时,使用 curl 进行模拟请求使用。
这个指令 curl 在 cmd (Windows) , PowerShell (Windows) 和 Linux 环境上有一些区别。

项目端口号是 80 , ip 是 127.0.0.1 (192.168.100.52)

Get 请求

普通请求

 @RequestMapping("/getOne")
    public String getOne() {
        return "一个普通的Get请求";
    }
curl http://localhost:8082/getOne

image.png

传入一个参数

 @RequestMapping("/getTwo")
    public String getTwo(String name) {
        return "一个普通的Get请求,名称是:"+name;
    }
curl http://localhost:8082/getTwo?name=岳建立

image.png

如果传入的参数有空格 等信息, 如 name = 岳建立 程序员

-- 错误
curl http://localhost:8082/getTwo?name=岳建立  程序员

-- 正确
curl http://localhost:8082/getTwo?name="岳建立  程序员"


image.png

传入多个参数时

    @RequestMapping("/getThree")
    public String getThree(String name,String sex) {
        return "一个普通的Get请求,名称是:"+name+",性别是:"+sex;
    }
-- 错误 
curl http://localhost:8082/getThree?name=yjl&sex=male

image.png

应该使用:

curl http://localhost:8082/getThree?name=yjl"&"sex=male

image.png

在 linux 下也是可以运行的.

image.png

linux 环境下 转码 处理

 curl --data-urlencode "name=岳建立 222" --data-urlencode "sex=男"  http://192.168.100.52:8082/getThree

image.png

pathvariable 注解接收参数

    @RequestMapping("/getFour/{name}/{sex}")
    public String getFour(@PathVariable("name") String name, @PathVariable("sex") String sex) {
        return "一个普通的 path variable 请求,名称是:"+name+",性别是:"+sex;
    }
curl http://localhost:8082/getFour/岳建立/男   

image.png

传入请求头 Authorization 等

 @RequestMapping("/getFive")
    public String getFive(String name, String sex, HttpServletRequest httpServletRequest) {
        // 获取请求头
        String authorization = httpServletRequest.getHeader("Authorization");
        if (!StringUtils.hasText(authorization)){
            return "未传入请求头 Authorization";
        }
        if (!"abcd".equals(authorization)){
            return "传入了错误的请求头";
        }
        return "一个普通的 path variable 请求,名称是:"+name+",性别是:"+sex;
    }

linux 和 shell 下传入 这样的命令是报错的

-- 错误
curl -H "Authorization=abcd" http://localhost:8082/getFive?name=岳建立"&"sex=

image.png

可以使用 -Headers @{“key”=“value”} 的形式

不传入请求头时:

curl http://localhost:8082/getFive?name=岳建立"&"sex=

image.png

传入请求头,但是请求头内容错误

curl -Headers @{"Authorization"="abcd3333"} http://localhost:8082/getFive?name=岳建立"&"sex=

image.png

传入正确的请求头

 curl -Headers @{"Authorization"="abcd"} http://localhost:8082/getFive?name=岳建立"&"sex=

image.png

在 linux 下 是错误的
image.png

获取请求头信息:

 @RequestMapping("/getSix")
    public String getSix(HttpServletRequest httpServletRequest) {
        // 获取请求头
        String authorization = httpServletRequest.getHeader("Authorization");
        String referer = httpServletRequest.getHeader("Referer");

        return "返回请求头 Authorization :" +authorization+",Referer:"+referer;
    }

PowerShell 多个请求头时, 使用 ; 号进行分隔

curl -Headers @{"Authorization"="abcd";"Referer"="www.yueshushu.top"}  http://127.0.0.1:8082/getSix

image.png

linux 追加 -H

curl http://192.168.100.52:8082/getSix -H "Authorization: abcd" -H "Referer: www"

image.png

是可以获取到请求头内容的。

设置 Referer 也可以使用 -e 参数

[root@lb02 ~]# curl http://192.168.100.52:8082/getSix 
-H "Authorization: abcd" -e "www.yueshushu.top"

返回请求头 Authorization :abcd,Referer:www.yueshushu.top[root@lb02 ~]# 

Post 请求

User.java

@Data
public class User implements Serializable {
    private String name;
    private String sex;
}

linux 下 简单 post

 @PostMapping("/postOne")
    public String postOne(@RequestBody User user) {
        return "一个普通的 post 请求,名称是:"+ user.getName()+",性别是:"+ user.getSex();
    }

-X 指定请求的方式 ,如 -X POST -X DELETE -X PUT

-d 指定参数, 传入的是 json 形式的字符串

先使用 linux 进行演示

curl -X POST -d '{"name":"岳建立","sex":"男"}' http://localhost:8082/postOne

进行请求, 说格式不正确, 需要用 application-json 的形式

image.png

需要添加请求头 -H “Content-Type: application/json”

curl -H "Content-Type: application/json" -X POST -d '{"name":"岳建立","sex":"男"}' "http://192.168.100.52:8082/postOne"

image.png

一定要注意, 传入的参数的 key 也要用 “” 括起来。

-d ‘{“name”:“岳建立”,“sex”:“男”}’ 不能写成 -d ‘{name:“岳建立”,“sex”:“男”}’

linux 下 携带请求头的 Post

 @PostMapping("/postTwo")
    public String postTwo(@RequestBody User user,HttpServletRequest httpServletRequest) {
        // 获取请求头
        String authorization = httpServletRequest.getHeader("Authorization");
        if (!StringUtils.hasText(authorization)){
            return "未传入请求头 Authorization";
        }
        if (!"abcd".equals(authorization)){
            return "传入了错误的请求头";
        }

        return "一个普通的 post 请求,名称是:"+ user.getName()+",性别是:"+ user.getSex();
    }

需要再传入一个请求头 -H “Authorization:abcd”

[root@mail ~]# curl -H "Content-Type: application/json"  -X POST -d '{"name":"岳建立","sex":"男"}' "http://192.168.100.52:8082/postTwo"
未传入请求头 Authorization[root@mail ~]# 
[root@mail ~]# curl -H "Content-Type: application/json" -H "Authorization:abcded"  -X POST -d '{"name":"岳建立","sex":"男"}' "http://192.168.100.52:8082/postTwo"
传入了错误的请求头[root@mail ~]# 
[root@mail ~]# 
[root@mail ~]# curl -H "Content-Type: application/json" -H "Authorization:abcd"  -X POST -d '{"name":"岳建立","sex":"男"}' "http://192.168.100.52:8082/postTwo"
一个普通的 post 请求,名称是:岳建立,性别是:男[root@mail ~]# 

PowerShell 使用 Post 请求

参考链接: https://www.jianshu.com/p/1bcf857eb876

-- 定义url
$uri = 'http://192.168.100.52:8082/postTwo'
-- 传入参数 
$hash =@{"name" = "yjl";"sex" = "male";}
-- 定义请求头		
$headers = @{"Authorization"="abcd";"Content-Type"="application/json"}
-- 参数转换
$JSON = $hash | convertto-json
-- 进行请求
 curl -Headers $headers -uri $uri -Method POST -Body $JSON
PS D:\curl> $uri = 'http://192.168.100.52:8082/postTwo'
PS D:\curl>
PS D:\curl> $hash =@{"name" = "yjl";"sex" = "male";}
PS D:\curl> $headers = @{"Authorization"="abcd";"Content-Type"="application/json"}
PS D:\curl> $JSON = $hash | convertto-json

PS D:\curl> curl -Headers $headers -uri $uri -Method POST -Body $JSON


StatusCode        : 200
StatusDescription :
Content           : 一个普通的 post 请求,名称是:yjl,性别是:male
RawContent        : HTTP/1.1 200
                    Content-Length: 56
                    Content-Type: text/plain;charset=UTF-8
                    Date: Mon, 28 Nov 2022 06:54:16 GMT

                    一个普通的 post 请求,名称是:yjl,性别是:male
Forms             : {}
Headers           : {[Content-Length, 56], [Content-Type, text/plain;charset=UTF-8], [Date, Mon, 28 Nov 2022 06:54:16 GMT]}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        : mshtml.HTMLDocumentClass
RawContentLength  : 56



PS D:\curl>

如果内容过长 或者只要内容的话, 可以使用 | Select -ExpandProperty Content

 curl -Headers $headers -uri $uri -Method POST -Body $JSON | Select -ExpandProperty Content  
PS D:\curl>  curl -Headers $headers -uri $uri -Method Post -Body $JSON | Select -ExpandProperty Content
一个普通的 post 请求,名称是:yjl,性别是:male

Put 请求

@PutMapping("/putTwo")
    public String putTwo(@RequestBody User user,HttpServletRequest httpServletRequest) {
        // 获取请求头
        String authorization = httpServletRequest.getHeader("Authorization");
        if (!StringUtils.hasText(authorization)){
            return "未传入请求头 Authorization";
        }
        if (!"abcd".equals(authorization)){
            return "传入了错误的请求头";
        }

        return "一个普通的 put 请求,名称是:"+ user.getName()+",性别是:"+ user.getSex();
    }
PS D:\curl> $uri = 'http://192.168.100.52:8082/putTwo'
PS D:\curl>
PS D:\curl> $hash =@{"name" = "yjl";"sex" = "male";}
PS D:\curl> $headers = @{"Authorization"="abcd";"Content-Type"="application/json"}
PS D:\curl> $JSON = $hash | convertto-json

PS D:\curl> curl -Headers $headers -uri $uri -Method PUT -Body $JSON


StatusCode        : 200
StatusDescription :
Content           : 一个普通的 put 请求,名称是:yjl,性别是:male
RawContent        : HTTP/1.1 200
                    Keep-Alive: timeout=60
                    Connection: keep-alive
                    Content-Length: 55
                    Content-Type: text/plain;charset=UTF-8
                    Date: Mon, 28 Nov 2022 07:00:50 GMT

                    一个普通的 put 请求,名称是:yjl,性别是:male
Forms             : {}
Headers           : {[Keep-Alive, timeout=60], [Connection, keep-alive], [Content-Length, 55], [Content-Type, text/plain;charset=UTF-8]...}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        : mshtml.HTMLDocumentClass
RawContentLength  : 55


PS D:\curl>

Delete 请求

   @DeleteMapping("/deleteTwo")
    public String deleteTwo(@RequestBody User user,HttpServletRequest httpServletRequest) {
        // 获取请求头
        String authorization = httpServletRequest.getHeader("Authorization");
        if (!StringUtils.hasText(authorization)){
            return "未传入请求头 Authorization";
        }
        if (!"abcd".equals(authorization)){
            return "传入了错误的请求头";
        }

        return "一个普通的 delete 请求,名称是:"+ user.getName()+",性别是:"+ user.getSex();
    }
PS D:\curl> $uri = 'http://192.168.100.52:8082/deleteTwo'
PS D:\curl>
PS D:\curl> $hash =@{"name" = "yjl";"sex" = "male";}
PS D:\curl> $headers = @{"Authorization"="abcd";"Content-Type"="application/json"}
PS D:\curl> $JSON = $hash | convertto-json

PS D:\curl> curl -Headers $headers -uri $uri -Method Delete -Body $JSON


StatusCode        : 200
StatusDescription :
Content           : 一个普通的 delete 请求,名称是:yjl,性别是:male
RawContent        : HTTP/1.1 200
                    Keep-Alive: timeout=60
                    Connection: keep-alive
                    Content-Length: 58
                    Content-Type: text/plain;charset=UTF-8
                    Date: Mon, 28 Nov 2022 07:02:34 GMT

                    一个普通的 delete 请求,名称是:yjl,性别是:male
Forms             : {}
Headers           : {[Keep-Alive, timeout=60], [Connection, keep-alive], [Content-Length, 58], [Content-Type, text/plain;charset=UTF-8]...}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        : mshtml.HTMLDocumentClass
RawContentLength  : 58


PS D:\curl>

将数据保存到文件里面

使用 -outfile “文件路径”

curl -Headers $headers -uri $uri -Method Post -Body $JSON -outfile "D:\\post.txt"

image.png

linux 使用 -o 路径

[root@mail ~]# curl -H "Content-Type: application/json" -H "Authorization:abcd"  -X POST -d '{"name":"岳建立","sex":"男"}' "http://192.168.100.52:8082/postTwo" -o /usr/post.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    93  100    61  100    32    661    346 --:--:-- --:--:-- --:--:--   663
[root@mail ~]# cat /usr/post.txt
一个普通的 post 请求,名称是:岳建立,性别是:男[root@mail ~]# 

上传文件

请求上传文件

-F 进行上传文件

    @PostMapping("/uploadFile")
    public String uploadFile(@RequestParam("file") MultipartFile file) {
        return "上传文件成功,文件名是:"+file.getOriginalFilename();
    }

-F ‘file=@/usr/post.txt;’ 其中 file 为 key , @后面加路径

[root@mail ~]# curl -H "Content-Type: multipart/form-data" -F 'file=@/usr/post.txt;' -X POST "http://192.168.100.52:8082/uploadFile"
上传文件成功,文件名是:post.txt[root@mail ~]# 

curl 对 FTP 的支持

展示目录

curl ftp://用户名:密码@www.yueshushu.top:21

[root@mail usr]# curl ftp://密码:用户名@www.yueshushu.top:21
-rw-r--r--    1 0        0            2202 Sep 15 09:19 item.csv

下载文件

curl ftp://www.yueshushu.top/item.csv –u 用户名:密码 -o item.csv

[root@mail usr]# curl ftp://密码:testftp@www.yueshushu.top:21
-rw-r--r--    1 0        0            2202 Sep 15 09:19 item.csv

[root@mail usr]# curl ftp://www.yueshushu.top/item.csv –u 密码:testftp -o item.csv
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0
curl: (67) Access denied: 530
<html><body><h1>403 Forbidden</h1>
Request forbidden by administrative rules.
</body></html>
<html><body><h1>403 Forbidden</h1>
Request forbidden by administrative rules.
</body></html>

上传文件

curl –u 用户名:密码 -T post.txt ftp://www.yueshushu.top/

[root@mail usr]# curl –u testftp:密码 -T post.txt ftp://www.yueshushu.top/
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0<html><body><h1>403 Forbidden</h1>
Request forbidden by administrative rules.
</body></html>
 60   154  100    93    0     0    150      0 --:--:-- --:--:-- --:--:--   150
<html><body><h1>403 Forbidden</h1>
Request forbidden by administrative rules.
</body></html>
curl: (67) Access denied: 530
[root@mail usr]# 

不太重要的属性

-A User-Agent

curl -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36" http://localhost:8082/getOne

-b 设置 cookie

$ curl -b 'foo=bar' http://localhost:8082/getOne

会生成一个 Cookie, foo = bar

–limit-rate 设置带宽

$ curl --limit-rate 200k http://localhost:8082/getOne 

带宽设置在 每秒 200 k

-v 展示全部内容

curl --limit-rate 200k -v http://192.168.100.52:8082/getOne 
[root@mail ~]# curl --limit-rate 200k -v http://192.168.100.52:8082/getOne 
* About to connect() to 192.168.100.52 port 8082 (#0)
*   Trying 192.168.100.52...
* Connected to 192.168.100.52 (192.168.100.52) port 8082 (#0)
> GET /getOne HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 192.168.100.52:8082
> Accept: */*
> 
< HTTP/1.1 200 
< Content-Type: text/plain;charset=UTF-8
< Content-Length: 24
< Date: Mon, 28 Nov 2022 07:50:24 GMT
< 
* Connection #0 to host 192.168.100.52 left intact
一个普通的Get请求[root@mail ~]# 

Curl 完整指令

# 调试类
-v, --verbose                          输出信息
-q, --disable                          在第一个参数位置设置后 .curlrc 的设置直接失效,这个参数会影响到 -K, --config -A, --user-agent -e, --referer
-K, --config FILE                      指定配置文件
-L, --location                         跟踪重定向 (H)

# CLI显示设置
-s, --silent                           Silent模式。不输出任务内容
-S, --show-error                       显示错误. 在选项 -s 中,当 curl 出现错误时将显示
-f, --fail                             不显示 连接失败时HTTP错误信息
-i, --include                          显示 response的header (H/F)
-I, --head                             仅显示 响应文档头
-l, --list-only                        只列出FTP目录的名称 (F)
-#, --progress-bar                     以进度条 显示传输进度

# 数据传输类
-X, --request [GET|POST|PUT|DELETE|]  使用指定的 http method 例如 -X POST
-H, --header <header>                  设定 request里的header 例如 -H "Content-Type: application/json"
-e, --referer                          设定 referer (H)
-d, --data <data>                      设定 http body 默认使用 content-type application/x-www-form-urlencoded (H)
    --data-raw <data>                  ASCII 编码 HTTP POST 数据 (H)
    --data-binary <data>               binary 编码 HTTP POST 数据 (H)
    --data-urlencode <data>            url 编码 HTTP POST 数据 (H)
-G, --get                              使用 HTTP GET 方法发送 -d 数据 (H)
-F, --form <name=string>               模拟 HTTP 表单数据提交 multipart POST (H)
    --form-string <name=string>        模拟 HTTP 表单数据提交 (H)
-u, --user <user:password>             使用帐户,密码 例如 admin:password
-b, --cookie <data>                    cookie 文件 (H)
-j, --junk-session-cookies             读取文件中但忽略会话cookie (H)
-A, --user-agent                       user-agent设置 (H)

# 传输设置
-C, --continue-at OFFSET               断点续转
-x, --proxy [PROTOCOL://]HOST[:PORT]   在指定的端口上使用代理
-U, --proxy-user USER[:PASSWORD]       代理用户名及密码

# 文件操作
-T, --upload-file <file>               上传文件
-a, --append                           添加要上传的文件 (F/SFTP)

# 输出设置
-o, --output <file>                    将输出写入文件,而非 stdout
-O, --remote-name                      将输出写入远程文件
-D, --dump-header <file>               将头信息写入指定的文件
-c, --cookie-jar <file>                操作结束后,要写入 Cookies 的文件位置

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/117996.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

MyISAM索引解析、InnoDB索引解析

我们经常说到的存储引擎是说数据库级别还是说表级别&#xff1f; 答&#xff1a;表级别。&#xff08;数据库级别也可以设置&#xff0c;但是最终它的级别生效是在表级别&#xff09; 1、MylSAM存储引擎索引实现 MylSAM索引文件和数据文件是分离的&#xff08;非聚集&#xf…

大数据开发中级练习题目(python超详细)

给定长度为m的非重复数组p&#xff0c;以及从其中取n&#xff08;n<m&#xff09;个数字组成新的子数组q。现要对p进行排序&#xff0c;要求&#xff1a;q在数组的最前方&#xff0c;其余数字按从小到大的顺序依次排在后面 输入样例&#xff1a; q [3, 5, 4] p [5, 4, 3…

37. 解数独

37. 解数独 编写一个程序&#xff0c;通过填充空格来解决数独问题。 数独的解法需 遵循如下规则&#xff1a; 数字 1-9 在每一行只能出现一次。 数字 1-9 在每一列只能出现一次。 数字 1-9 在每一个以粗实线分隔的 3x3 宫内只能出现一次。&#xff08;请参考示例图&#xff…

SAP 财务年结操作宝典

目录 一 、后台操作篇 1.1 维护会计凭证编号范围 2.2 维护CO版本 1.3 维护利润中心版本 1.4 维护物料分类账文档的编号范围 (如 1.5 复制合并凭证编号范围(如果公司没有这个业务的) 1.6 维护发票凭证的编号范围间隔 (如果不针对年度则不用维护) 1.7 维护发票凭证的编号范…

MCU-51:单片机串口详解

目录一、计算机通信简介二、串口通信简介2.1 同步通信2.2 异步通信三、串行通信的传输方式四、串口通信硬件电路五、常见接口介绍六、串口相关寄存器详解6.1 特殊功能寄存器SCON6.2 PCON寄存器6.3 TMOD寄存器七、代码演示-单片机和电脑通信7.1 串口向电脑发送数据7.2 电脑通过串…

YOLO-V5 算法和代码解析系列(二)—— 【train.py】核心内容

文章目录调试设置整体结构代码解析ModelTrainloader分布式训练FreezeOptimizerSchedulerEMA调试设置 调试平台&#xff1a;Ubuntu&#xff0c;VSCode 调试设置&#xff0c;打开【/home/slam/kxh-1/2DDection/yolov5/.vscode/launch.json】&#xff0c;操作如下图所示&#xff…

GNN基础知识

1. 泰勒公式 背景background 有一个很复杂的方程&#xff0c;我们直接计算方程本身的值可能非常麻烦。 所以我们希望能够找到一个近似的方法来获得一个足够近似的值 本质&#xff1a; 近似&#xff0c;求一个函数的近似值 one point is 近似的方法another point is 近似的…

【Java 数据结构】-优先级队列以及Java对象的比较

作者&#xff1a;学Java的冬瓜 博客主页&#xff1a;☀冬瓜的主页&#x1f319; 专栏&#xff1a;【Java 数据结构】 分享&#xff1a;美妙人生的关键在于你能迷上什么东西。——《球状闪电》 主要内容&#xff1a;优先级队列底层的堆&#xff0c;大堆的创建&#xff0c;插入&a…

Openssl 生成自签名证书

最近在调试Ingress需要使用多份证书&#xff0c;对证书的生成和使用做了简单的整理。 不用翻垃圾桶一条过 #!/bin/sh output_dir"/opt/suops/k8s/ingress-files/certs/fanht-create-ssl/" read -p "Enter your domain [www.example.com]: " DOMAIN echo…

C++11特性-线程

并发 一个程序执行多个独立任务&#xff0c;提高性能 单核cpu是通过(任务切换)&#xff0c;即上下文切换&#xff0c;有时间开销 多核cpu(当核数>任务数)&#xff0c;硬件并发 进程 运行起来的一个可执行程序&#xff08;一段程序的运行过程&#xff09; 资源分配的最小单…

百数应用中心上新了——餐饮门店管理系统

随着智能化时代的来临&#xff0c;传统的餐饮门店管理方式逐渐暴露出缺陷。不少餐饮业的掌门人都纷纷对管理方式进行了转型&#xff0c;由传统模式转变为数字化系统的管理。然而数字化管理方式也没那么容易进行&#xff0c;想要百分百满足需求的系统耗时耗力耗钱&#xff0c;成…

不懂PO 设计模式?这篇实战文带你搞定 PO

1080442 73.1 KB 为UI页面写测试用例时&#xff08;比如web页面&#xff0c;移动端页面&#xff09;&#xff0c;测试用例会存在大量元素和操作细节。当UI变化时&#xff0c;测试用例也要跟着变化&#xff0c; PageObject 很好的解决了这个问题&#xff01; 使用UI自动化测试工…

钉钉 ANR 治理最佳实践 | 定位 ANR 不再雾里看花

作者&#xff1a;姜凡(步定) 本文为《钉钉 ANR 治理最佳实践》系列文章首篇《定位 ANR 不再雾里看花》&#xff0c;主要介绍了钉钉自研的 ANRCanary 通过监控主线程的执行情况&#xff0c;为定位 ANR 问题提供更加丰富的信息。 后续将在第二篇文章中讲述钉钉基于分析算法得出 …

【TuyaOS开发之旅】BK7231N GPIO的简单使用

接口讲解 GPIO初始化 /*** brief gpio 初始化* * param[in] pin_id: 需要初始化的GPIO编号&#xff0c; 对应TUYA_GPIO_NUM_E枚举* param[in] cfg: gpio 配置** return OPRT_OK on success. Others on error, please refer to tuya_error_code.h*/ OPERATE_RET tkl_gpio_ini…

基于SpringBoot工程开发Docker化微服务

目录 1. 微服务容器化治理的优缺点 1.1 微服务容器化的优点 1.2 微服务容器化的缺点 2. 微服务的两种模式 2.1 Microservice SDK 2.2 ServiceMesh 3. 微服务容器化治理的推荐模式 4.Windows下开发容器化微服务&#xff08;非K8S&#xff09; 4.1 开发环境 4.2 代码框架…

全网最新、最详细的使用burpsuite验证码识别绕过爆破教程(2023最新)

1、前沿 最近一直在研究绕过验证码进行爆破的方法&#xff0c;在这里对自己这段时间以来的收获进行一下分享。在这里要分享的绕过验证码爆破的方法一共有2个&#xff0c;分为免费版本&#xff08;如果验证码比较奇怪可能会有识别错误的情况&#xff09;和付费版本&#xff08;…

【Qt】QtCreator远程部署、调试程序

1、添加远程设备 1)QtCreator 工具–> 选项 --> 设备 --> 添加 2)设备设置向导选择–> Generic Linux Device --> 开启向导 3)填写“标识配置的名称”(随便写)、设备IP、用户名 --> 下一步 4)选择配对秘密文件,第一次配对,可以不填写,点击“下一…

嵌入式:ARM嵌入式系统开发流程概述

文章目录嵌入式开发的具体过程开发流程图嵌入式软件开发环境交叉开发环境远程调试结构图嵌入式应用软件开发的基本流程软件模拟环境目标板与评估板嵌入式软件开发的可移植性和可重用性嵌入式开发的具体过程 系统定义与需求分析阶段方案设计阶段详细设计阶段软硬件集成测试阶段…

Tomcat架构分析—— Engine

文章目录一、Tomcat的核心模块&#xff08;核心组件&#xff09;二、Engine 组件1.核心类与依赖图2.核心类源码分析构造函数&#xff1a;初始化方法 init&#xff1a;启动方法 start&#xff1a;3.Engine的启动过程总结一、Tomcat的核心模块&#xff08;核心组件&#xff09; …

机器学习之支持向量机(手推公式版)

文章目录前言1. 间隔与支持向量2. 函数方程描述3. 参数求解3.1 拉格朗日乘数3.2 拉格朗日对偶函数前言 支持向量机(Support(Support(Support VectorVectorVector Machine,SVM)Machine,SVM)Machine,SVM)源于统计学习理论&#xff0c;是一种二分类模型&#xff0c;是机器学习中获…