Ask Your Question
1

query to api via curl - response 400 [closed]

asked 2019-08-29 02:41:07 -0500

senset gravatar image

I've nginx frontend:

server {
        listen 80;
        server_name somename.com;
        location / {
                proxy_pass http://127.0.0.1:18630/;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
        }
}

and I've pipelineid:

Testpipeline3191f06e-b154-4f9f-ac9b-925a7222b272

when I use web-interface to stop that pipeline:

pipeline is stopping with 200 responce code
but when I use curl:
curl -X POST -H "Content-Type: application/json" http://somename.com/rest/v1/pipeline/Testpipeline3191f06e-b154-4f9f-ac9b-925a7222b272/stop?rev=0

I got that:

HTTP ERROR 400

Both querys in nginx logs:

<ip> - - [<date>] "POST /rest/v1/pipeline/Testpipeline3191f06e-b154-4f9f-ac9b-925a7222b272/stop?rev=0 HTTP/1.1" 200 484 "http://somename.com/collector/restapi" "Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0"
<ip> - <auth_name> [<date>] "POST /rest/v1/pipeline/Testpipeline3191f06e-b154-4f9f-ac9b-925a7222b272/stop?rev=0 HTTP/1.1" 400 397 "-" "curl/7.47.0"

What I doing wrong?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by senset
close date 2019-08-29 02:55:40.407174

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-08-29 02:55:16 -0500

senset gravatar image
-H "X-Requested-By: Data Collector"

must be added via curl

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-08-29 02:41:07 -0500

Seen: 7 times

Last updated: Aug 29