Rest API post request

I want to sent post request to my graylog server for extractors. like below:

curl -X "POST" "https://localhost:9000/api/system/inputs/INPUTID/extractors" \
     -H 'X-Requested-By: admin' \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -u 'admin:PASSWORD' \
     -d $'{"title":"title","cut_or_copy":"copy","source_field":"message","target_field":"action","extractor_type":"regex","extractor_config":{"regex_value":" R:(\\S) "},"converters":{},"condition_type":"regex","condition_value":"value"}'

or with token like this:

curl -u \
-H 'X-Requested-By: MYUSER Accept: application/json' \
-X POST 'https://localhost:9000/api/system/inputs/INPUTID/extractors' \
-d '{"title":"title","cut_or_copy":"copy","source_field":"message","target_field":"action","extractor_type":"regex","extractor_config":{"regex_value":" R:(\\S) "},"converters":{},"condition_type":"regex","condition_value":"value"}'

But are not working. Sent 415 error like belowe:

{"type":"ApiError","message":"HTTP 415 Unsupported Media Type"}

How can i do, result this problem/error?


Good Question,
I have also had this issue in the API browser, still working on 'Why, & What" is causing this.

ı can use API browser. I try it is it working, but curl request not running.

Oh I see,
Someone else had this issue, I’m not sure exactly what post but you can check here

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.