Mantis REST API: Summary not Specified
Posted: 12 Aug 2020, 07:54
Moin zusammen,
Wenn ich über die REST API einen neuen Eintrag anlegen möchte, dann bekomme ich immer "Summary not specified" zurück.
Ich setze über curl das folgende Kommando ab:
curl --location --request POST "{URL}/mantisbt/api/rest/issues/" --header "Authorization: {Token}" --header "Content-Type: application/json" --data-raw '{"summary":"Test Summary","description":"Test Description","category":{"id":1},"project":{"id":19}}' --verbose -w "|%{http_code}"
Über stdout bekomme ich folgende Antwort:
{"message":"Summary not specified","code":11,"localized":"Ein notwendiges Feld \u201esummary\u201c war leer. \u00dcberpr\u00fcfen Sie Ihre Eingabe."}|400
Über stderr erhalte ich diesen Log:
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying {URL}...
* TCP_NODELAY set
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to {URL} ({URL}) port 80 (#0)
} [85 bytes data]
* upload completely sent off: 85 out of 85 bytes
{ [149 bytes data]
100 234 100 149 100 85 149 85 0:00:01 --:--:-- 0:00:01 1000
* Closing connection 0
Das --request wegzulassen habe ich schon probiert, dann steht dort stattdessen "curl: (6) Could not resolve host: POST"
Mantis Versionsdaten:
MantisBT-Version 2.24.1
Schema-Version 210
PHP-Version 7.3.20
Datenbanktreiber mysqli
Datenbankversion, Beschreibung 10.4.8, 10.4.8-MariaDB
Wie setze ich das Kommando korrekt ab um einen neuen Eintrag in Mantis anzulegen?
Wenn ich über die REST API einen neuen Eintrag anlegen möchte, dann bekomme ich immer "Summary not specified" zurück.
Ich setze über curl das folgende Kommando ab:
curl --location --request POST "{URL}/mantisbt/api/rest/issues/" --header "Authorization: {Token}" --header "Content-Type: application/json" --data-raw '{"summary":"Test Summary","description":"Test Description","category":{"id":1},"project":{"id":19}}' --verbose -w "|%{http_code}"
Über stdout bekomme ich folgende Antwort:
{"message":"Summary not specified","code":11,"localized":"Ein notwendiges Feld \u201esummary\u201c war leer. \u00dcberpr\u00fcfen Sie Ihre Eingabe."}|400
Über stderr erhalte ich diesen Log:
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying {URL}...
* TCP_NODELAY set
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to {URL} ({URL}) port 80 (#0)
} [85 bytes data]
* upload completely sent off: 85 out of 85 bytes
{ [149 bytes data]
100 234 100 149 100 85 149 85 0:00:01 --:--:-- 0:00:01 1000
* Closing connection 0
Das --request wegzulassen habe ich schon probiert, dann steht dort stattdessen "curl: (6) Could not resolve host: POST"
Mantis Versionsdaten:
MantisBT-Version 2.24.1
Schema-Version 210
PHP-Version 7.3.20
Datenbanktreiber mysqli
Datenbankversion, Beschreibung 10.4.8, 10.4.8-MariaDB
Wie setze ich das Kommando korrekt ab um einen neuen Eintrag in Mantis anzulegen?