我正在嘗試使用Curl從Microsoft Dynamics Nav中抽取一些數據。使用Curl爲Dynamics Nav驗證OData
我可以很容易地通過我的瀏覽器訪問它在這個URL:http://kevans:(password)@192.168.0.30:8048/Sandbox/OData/
,它工作得很好。
在Curl中,我試過這個:curl --ntlm -u kevans "http://192.168.0.30:8048/Sandbox/OData/" -v
,在提示符下鍵入我的密碼,但它返回401未授權錯誤。
有什麼需要做的,以使其可用於捲曲?
這裏是捲曲的輸出:
curl --ntlm -u kevans "http://192.168.0.30:8048/Sandbox/OData/" -v
Enter host password for user 'kevans':
* About to connect() to 192.168.0.30 port 8048 (#0)
* Trying 192.168.0.30...
* Adding handle: conn: 0x525fe0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x525fe0) send_pipe: 1, recv_pipe: 0
* Connected to 192.168.0.30 (192.168.0.30) port 8048 (#0)
* Server auth using NTLM with user 'kevans'
> GET /Sandbox/OData/ HTTP/1.1
> Authorization: NTLM TlRMTVNTUAABAAAAt4II4gAAAAAAAAAAAAAAAAAAAAAGA4AlAAAADw==
> User-Agent: curl/7.33.0
> Host: 192.168.0.30:8048
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Content-Length: 0
* Server Microsoft-HTTPAPI/2.0 is not blacklisted
< Server: Microsoft-HTTPAPI/2.0
< WWW-Authenticate: Negotiate
< Date: Thu, 05 Feb 2015 20:25:26 GMT
<
* Connection #0 to host 192.168.0.30 left intact
事情我已經嘗試:使用--negotiate
參數使用--ntlm
--anyauth
-u MYDOMAIN\kevans
- 使用
-u MYDOMAIN\kevans:password
和-u kevans:password