如果我在shell中运行这样的东西:
curl -I http://example.com -H "If-None-Match: \"da8e7e-557a9-4cbc6f2e68780\""
http_code=$(curl -I $SELL_URI -H "If-None-Match: "\$etag\"" | grep ...)
我的curl -I $SELL_URI -H "If-None-Match: "\"$etag\"看起来像这样:
$"-None-Match: "da8e7e-557a9-4cbc6f2e68780
你可以把标题放在单引号中,如下所示:
curl -I http://example.com -H 'If-None-Match: "da8e7e-557a9-4cbc6f2e68780"'