简体   繁体   中英

Xpost using libcurl in C++

I'm currently using curl in bash and have something like this:

cat req
{ "index" : { "_index": "override", "_type" : "type1", "_id" : "1" } }
{ "field1" : "value1" }
curl -XPOST  localhost:80/testing/_bulk --data-binary @req

However I'm now building a c++ program and I'm trying to achieve the same thing. I can't seem to find any c++ examples to do "xpost" but I have found code which claims to do post:

http://curl.haxx.se/libcurl/c/postit2.html

Is this the right approach or am I barking up the wrong tree again? If I am, can anyone give me a nudge in the right direction please.

没有“ xpost”之类的东西,请查看简单文章示例http://curl.haxx.se/libcurl/c/simplepost.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM