gpt4 book ai didi

json - Wget 窗口和多个 --header 开关

转载 作者:行者123 更新时间:2023-12-05 01:21:12 25 4
gpt4 key购买 nike

我正在尝试使用在 Windows Server 2003 上运行的 wget 1.11.4 对网站执行一些 JSON。我可以检索信息,但我无法发送任何信息。我不确定我的 JSON 格式是否正确,但似乎存在更根本的问题。

如果我这样做:

wget --header="Authorization: Bearer <redacted>" --no-check-certificate --post-data="{'workspaces':{'title':'CMC Regulatory Support','creator_role':'maven'}}"  https://api.mavenlink.com/api/v1/workspaces.json

我从网站“错误 422:无法处理的实体”返回 JSON 错误。但是如果我添加另一个 --header:

wget -S --header="Authorization: Bearer <redacted>" -–header="Content-Type: application/json" --no-check-certificate --post-data="{'workspaces':{'title':'CMC Regulatory Support','creator_role':'maven'}}"  https://api.mavenlink.com/api/v1/workspaces.json

我得到:

SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = C:\Program Files\GnuWin32/etc/wgetrc
wget: invalid option -- û
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.

但手册中明确指出允许使用多个 --header 开关,而且我看到 swithc 在网络上的示例中使用?。什么鬼?

最佳答案

Content-Type 之前的第二个 --header 参数包含不同的破折号。

--header="Content-Type

如果您修复它,wget 将发送请求。

关于json - Wget 窗口和多个 --header 开关,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21839312/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com