Importing Kibana saved objects without CURL

Hi i'm currently trying to make a kibana api call using pascal however i'm not sure how to convert the CURL request. This curl request is working from command prompt.

curl -X POST "localhost:5601/api/saved_objects/_import?createNewCopies=true" -H "kbn-xsrf: true" --form file=@export.ndjson

However when I try to make an http request with pascal its returning an error, I don't know how to use the --form through code. The method should be similar with other http requests as well so I was wondering in anyone know how to do it.

Thanks!

api/saved_objects/_import expects multipart/form-data content type.

kibana api call using pascal

I've never worked with Pascal, but I'm sure there is an HTTP client with form multipart/form-data support. I found several code snippets here

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