简体   繁体   中英

MarkLogic 8: Cannot load a XML document to MarkLogic database using cURL

I'm practicing to load a simple XML document (I name it one.xml) with content:

<one>
 <child>The noble Brutus has told Caesar was ambitious</child>
</one>

to MarkLogic DB.

I run curl tool (Windows cmd) at one.xml's directory and type the following command line:

   curl --anyauth --user user:password -x put  -d@"./one.xml" ^
   -h "Content-type: application/xml" ^
   "http://localhost:8000/LATEST/documents?uri=/xml/one.xml"

So if the request succeeds, the service returns status 201 (Document Created). But nothing happened. Instead, I received the results of the "curl --help" command.

I folllow the instructions of MarkLogic website. Link: https://docs.marklogic.com/8.0/guide/rest-dev/intro#id_97899

Scroll down to the Getting Started with the MarkLogic REST API article. I am stuck at Load Documents Into the Database

P/S: The curl command line in the MarkLogic website use Unix syntax, so I changed it to Windows syntax following this link https://docs.marklogic.com/8.0/guide/rest-dev/intro#id_75672

I think this is a problem. Please help me

You mistyped the -X parameter , it must be upper-case X. Lower-case x parameter is used for something else..

HTH!

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