0

我想使用 Harbor API 添加用户。在文档中,它告诉像这样放置 X-Request-Id: 在此处输入图像描述

我是这样做的:

curl --location --request POST 'https://myharborserver.com/users' --header 'Authorization: Basic YWRtaW46SGFyYm9yQDEyMw==' --header 'Content-Type: application/json' --header 'Cookie: _gorilla_csrf=MTYzNDcyMDEyMXxJbXA0Vm5OeE4wMDNZbmRMT1dkb04wVlFSMk0yUWxac1ZVZzFSamQ0Y1ZRMVpqQlBiM1JFTUZsb0wyODlJZ289fK-21Siv4oJUJiOYE0WIxcyp38osIremX7hNIGQEvn_8; sid=ea0dad61038d4270e0959a3cb92ed76e' --data-raw '{
  "comment": "",
  "username": "ehsan",
  "password": "1",
  "email": "ehsan.shirzadi@gmail.com",
  "realname": "Ehsan Shirzadi"
}'

我什至尝试添加这个:

--header 'X-Request-Id: 45232434-158b-4512-bb6a-1c532749d752'

但是一个错误说:405 Not Allowed 怎么了?

4

0 回答 0