MantisBT Rest API - PullRequest
       38

MantisBT Rest API

0 голосов
/ 30 января 2020

В настоящее время я пытаюсь создать проблему Mantis через Rest Api с помощью запроса curl (который затем выполняется с консоли Windows). Авторизация токена работает хорошо, но я получаю ошибку 400 (Сводка не указана), хотя она и включена в запрос. MantisBT (v2.23.0) размещен на docker.

Any idea of what might cause this?

curl --location --request POST http://mantisdomain.com/api/rest/issues --header Authorization:xxxxxxxxxxxx^
 --user site.web@sfr-ftth.com:TYZw2grM^
 --header 'Content-Type:application/json'^
 --verbose --globoff^
 --data-urlencode '{"summary":"summarysample","category_id":"1","description":"Description for sample REST issue.","project":{"id":11,"name":"Test"},"custom_fields":[{"field":{"id":"custom_field_10","name":"custom_field_10"},"value":"va"},^
        {"field":{"id":"custom_field_11","name":"custom_field_11"},"value":"00000"},^
        {"field":{"id":"custom_field_12","name":"custom_field_12"},"value":"vav"},^
        {"field":{"id":"custom_field_13","name":"custom_field_13"},"value":"Beton"},^
        {"field":{"id":"custom_field_14","name":"custom_field_14"},"value":"Casse"},^
        {"field":{"id":"custom_field_15","name":"custom_field_15"},"value":"Oui"},^
        {"field":{"id":"custom_field_32","name":"custom_field_32"},"value":"Detendu"},^
        {"field":{"id":"custom_field_16","name":"custom_field_16"},"value":"Facade"},^
        {"field":{"id":"custom_field_23","name":"custom_field_23"},"value":"vpl"},^
        {"field":{"id":"custom_field_24","name":"custom_field_24"},"value":"99"},^
        {"field":{"id":"custom_field_21","name":"custom_field_21"},"value":"Chaussee"},^
        {"field":{"id":"custom_field_22","name":"custom_field_22"},"value":"Cassee"},^
        {"field":{"id":"custom_field_25","name":"custom_field_25"},"value":"var"},^
        {"field":{"id":"custom_field_26","name":"custom_field_26"},"value":"Ouverte"},^
        {"field":{"id":"custom_field_29","name":"custom_field_29"},"value":"Oui"},^
        {"field":{"id":"custom_field_30","name":"custom_field_30"},"value":"Oui"},^
        {"field":{"id":"custom_field_31","name":"custom_field_31"},"value":"vac"},^
        {"field":{"id":"custom_field_27","name":"custom_field_27"},"value":"2.5"},^
        {"field":{"id":"custom_field_28","name":"custom_field_28"},"value":"50.5"},^
        {"field":{"id":"custom_field_17","name":"custom_field_17"},"value":"Collectivite"},^
        {"field":{"id":"custom_field_18","name":"custom_field_18"},"value":"vdn"},^
        {"field":{"id":"custom_field_19","name":"custom_field_19"},"value":"vde"},^
        {"field":{"id":"custom_field_20","name":"custom_field_20"},"value":"0123456789"}]}'

and the answer : 
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
< HTTP/1.1 400 Summary not specified
< Server: nginx/1.9.3
< Date: Thu, 30 Jan 2020 14:41:33 GMT
< Content-Type: application/json
< Content-Length: 195
< Connection: keep-alive
< X-Powered-By: PHP/7.4.1
< Set-Cookie: PHPSESSID=17537c8b2ed742d81637270003ce638f; path=/; HttpOnly
< Cache-Control: private, max-age=10800
< Last-Modified: Wed, 08 Jan 2020 13:56:17 GMT
<
{"message":"Summary not specified","code":11,"localized":"Le champ obligatoire \u00ab\u202fsummary\u202f\u00bb n\u2019est pas renseign\u00e9. Veuillez v\u00e9rifier \u00e0 nouveau votre saisie."}* Connection #0 to host mantis.sfr-ftth.com left intact


Thank you in advance for the read!
...