Skip to content

这个点击在终端访问接口的按钮在windows上不支持,要不在加一个按钮 #101

@leijingxing

Description

@leijingxing
Image

PowerShell 不支持以 --xxx 开头的参数行开头写法,它会把 --data-raw 当成 “减号开头的表达式”,从而触发:

Missing expression after unary operator '--'

PowerShell 不能让一行以 --xxx 开头,会被误解成数学表达式 → 报错。

比如这样:
curl --location --compressed --request GET
'http://10.1.34.16:30024/api/dub-control/riskAnalysisTaskCheckPlan/taskDetail?id=01k85etfwwzt33h41k9mcpqzm7&id=01k85etfwwzt33h41k9mcpqzm7'
--header 'user-agent: Dart/3.9 (dart:io)'
--header 'content-type: application/json'
--header 'authorization: Bearer 410f1ccb-746e-4d0b-827c-0fe44ddfc9b9'
--data-raw ''

在windows可以改为
Invoke-RestMethod -Method GET -Uri "http://10.1.34.16:30024/api/dub-control/riskAnalysisTaskCheckPlan/taskDetail?id=01k85etehqtv53g07rvcnp7npa&id=01k85etehqtv53g07rvcnp7npa"
-Headers @{
"user-agent" = "Dart/3.9 (dart:io)"
"content-type" = "application/json"
"authorization" = "Bearer 410f1ccb-746e-4d0b-827c-0fe44ddfc9b9"
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions