我正在学习Apigility( Apigility docu – > REST Service Tutorial ),并尝试通过cURL发送带有基本身份validation的POST请求: $ curl -X POST -i -H "Content-Type: application/hal+json" -H "Authorization: Basic YXBpdXNlcjphcGlwd2Q=" http://apigilityhw.sandbox.loc/status YXBpdXNlcjphcGlwd2Q=是我的证书apiuser:apipwd的基础64编码的string。 凭证保存在/data/htpasswd ( apiuser:$apr1$3J4cyqEw$WKga3rQMkxvnevMuBaekg/ )中。 看起来像这样: HTTP/1.1 401 Unauthorized Server: nginx/1.4.7 Date: Mon, 22 Sep 2014 07:48:47 GMT Content-Type: application/problem+json Transfer-Encoding: chunked Connection: keep-alive X-Powered-By: PHP/5.5.12-1~dotdeb.1 WWW-Authenticate: Basic realm="api" 这里的错误在哪里? 如何得到它的工作?