Thank You David and Christopher. I tried the verbose option and --anyauth but
result is same. I think its a Windows issue.
$ curl -s -X POST --anyauth --user admin:admin -d"{\"rest-api\" :
{\"name\":\"5minguide\",\"database\":\"5minguide\",\"port\":8010}}" -H
"Content-type: application/json" "http://localhost:8002/v1/rest-apis" -v*
Trying ::1...* Trying 127.0.0.1...* Connected to localhost (127.0.0.1) port
8002 (#0)> POST /v1/rest-apis HTTP/1.1> 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 401 Unauthorized<
Server: MarkLogic< WWW-Authenticate: Digest realm="public", qop="auth",
nonce="e372815b4d3c54d41be29ca24fde28a6", opaque="a2feba3abeb3c998"<
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:
0x1eab700* 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="",nonce="e372815b4d3c54d41be29ca24fde28a6",uri="/v1/rest-apis",cnonce="b41fbd257367de8ca0979861ccb34146",nc=00000001,response="ef4d10c5660f251368c1d29e9e101a89",qop="auth",opaque="a2feba3abeb3c998">
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 401 Unauthorized< Server: MarkLogic* Authentication problem.
Ignoring this.< WWW-Authenticate: Digest realm="public", qop="auth",
nonce="77136e2739afd607d97fa94aa2980032", opaque="cf079ec0a1bc6777"<
Content-Type: text/html; charset=utf-8< Content-Length: 209< Connection:
Keep-Alive< Keep-Alive: timeout=5<<html xmlns="http://www.w3.org/1999/xhtml">
<head> <title>401 Unauthorized</title> <meta name="robots"
content="noindex,nofollow"/> </head> <body> <h1>401 Unauthorized</h1>
</body></html>* Connection #0 to host localhost left intact
Thank You. I will try mac then.regards,Puneet
From: [email protected]
To: [email protected]
Subject: 401 Unauthorized
Date: Thu, 16 Apr 2015 18:08:45 +0530
Hi All,I have been struggling with a basic authentication error and I know it
is something simple. I am using Marklogic 8 on Win8 and I am trying to create a
REST API instance using Curl CLI. The command that I am using is curl -s -X
POST --digest --user admin:admin -d"{\"rest-api\" :
{\"name\":\"5minguide\",\"database\":\"5minguide\",\"port\":8010}}" -H
"Content-type: application/json" "http://localhost:8002/v1/rest-apis"I am using
admin:admin to authenticate to the http://localhost:8001 (admin console) but
everytime I run the above command I get the following error
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>401
Unauthorized</title> <meta name="robots" content="noindex,nofollow"/>
</head> <body> <h1>401 Unauthorized</h1> </body></html>
can anyone confirm if I am user the right user? or role required to create REST
API instance?Thanks in advance.regards,Puneet
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general