I just ran something similar (just added -v for verbose, different port):

chamlin@MacPro:~$ curl -s -v -X POST --digest --user admin:admin
-d"{\"rest-api\" :
{\"name\":\"5minguide\",\"database\":\"5minguide\",\"port\":8040}}" -H
"Content-type: application/json" "http://localhost:8002/v1/rest-apis";
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8002 (#0)
* Server auth using Digest with user 'admin'
> POST /v1/rest-apis HTTP/1.1
> User-Agent: curl/7.41.0
> Host: localhost:8002
> Accept: */*
> Content-type: application/json
> Content-Length: 0
>
< HTTP/1.1 401 Unauthorized
< Server: MarkLogic
< WWW-Authenticate: Digest realm="public", qop="auth",
nonce="484e21ec878d1a003e671d3e2399fc8a", opaque="d42e70b734c2bcab"
< Content-Type: text/html; charset=utf-8
< Content-Length: 209
< Connection: Keep-Alive
< Keep-Alive: timeout=5
<
* Ignoring the response-body
* Connection #0 to host localhost left intact
* Issue another request to this URL: 'http://localhost:8002/v1/rest-apis'
* Found bundle for host localhost: 0x7fce6ac245c0
* Re-using existing connection! (#0) with host localhost
* Connected to localhost (127.0.0.1) port 8002 (#0)
* Server auth using Digest with user 'admin'
> POST /v1/rest-apis HTTP/1.1
> Authorization: Digest username="admin", realm="public", 
> nonce="484e21ec878d1a003e671d3e2399fc8a", uri="/v1/rest-apis", 
> cnonce="YmVkYWE4MTZlM2VlN2EwNDEzN2E1MmQ2NzkyZmFmOTU=", nc=00000001, qop=auth, 
> response="99a26bb5c76cf7af9d5e2179d7ca1bd7", opaque="d42e70b734c2bcab"
> User-Agent: curl/7.41.0
> Host: localhost:8002
> Accept: */*
> Content-type: application/json
> Content-Length: 70
>
* upload completely sent off: 70 out of 70 bytes
< HTTP/1.1 201 Created
< Server: MarkLogic
< Content-Length: 0
< Connection: Keep-Alive
< Keep-Alive: timeout=5
<
* Connection #0 to host localhost left intact

So, it works for me (on a Mac).  Could it be a Windows thing?  Maybe
related:  http://curl.haxx.se/mail/lib-2015-02/0170.html

/ch
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to