我正在使用 curl 打开一个 URL。如果适用于几个 URL。但是很少有人给我一个错误报告。当我在浏览器中打开相同的 url 时,它工作正常。浏览器和 curl 命令的输出应该是相同的,但它不是。可能是什么原因?
$ curl 'http://server:port/ABC_Service/app'
<html><head><title>VMware vFabric tc Runtime 2.6.4.RELEASE/6.0.35.A.RELEASE - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 401 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>This request requires HTTP authentication ().</u></p><HR size="1" noshade="noshade"><h3>VMware vFabric tc Runtime 2.6.4.RELEASE/6.0.35.A.RELEASE</h3></body></html>
预期输出:
$ curl 'http://server:port/ABC_Service/app'
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
浏览器中的输出(第 1 2 行):
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <appMetadata>