我使用新的HTTP连接器收到意外的404错误,无法找出原因。
这个卷曲与我试图制作相同的电话,并按预期工作:
curl -H "X-AuntBertha-Signature: AUTH_SIG" \
https://searchbertha-hrd.appspot.com/_ah/api/search/v1/programs/4818166?api_key=MY_API_KEY \
> resources_dump.json
但是,此流程无效。供应商告诉我,他们甚至看不到请求显示在他们的日志中,所以有些东西很时髦。
<http:request-config name="AuntBertha_Production" host="searchbertha-hrd.appspot.com" basePath="/_ah/api/search/v1/" doc:name="HTTP Request Configuration" port="443" protocol="HTTPS" />
<!-- clipped... -->
<flow name="FetchResource">
<!-- clipped... -->
<http:request config-ref="AuntBertha_Production" path="/programs/4818166" method="GET" doc:name="Fetch from AB">
<http:request-builder>
<http:query-param paramName="api_key" value="MY_API_KEY"/>
<http:header headerName="X-AuntBertha-Signature" value="AUTH_SIG"/>
</http:request-builder>
<http:success-status-code-validator values="200,404,500"/>
</http:request>
以下是我在我的控制台中收到的日志(在this question的帮助下):
DEBUG 2015-07-14 16:19:55,202 [[resource_bulk_upload].HTTP_Default_Listener.worker.01] com.ning.http.client.providers.grizzly.GrizzlyConnectionsPool: [poll] Found pooled connection [TCPNIOConnection{localSocketAddress={/192.168.0.2:49878}, peerSocketAddress={searchbertha-hrd.appspot.com/209.85.147.141:443}}] for uri [https://searchbertha-hrd.appspot.com:443].
DEBUG 2015-07-14 16:19:55,203 [[resource_bulk_upload].HTTP_Default_Listener.worker.01] com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider: REQUEST: HttpRequestPacket (
method=GET
url=/_ah/api/search/v1/programs/4818166
query=api_key=MY_API_KEY
protocol=HTTP/1.1
content-length=-1
headers=[
Host=searchbertha-hrd.appspot.com:443
X-AuntBertha-Signature=AUTH_SIG
Connection=keep-alive
Accept=*/*
User-Agent=NING/1.0]
)
DEBUG 2015-07-14 16:19:55,262 [[resource_bulk_upload].http.requester.AuntBertha_Production(3) SelectorRunner] com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider: RESPONSE: HttpResponsePacket (
status=404
reason=Not Found
protocol=HTTP/1.1
content-length=-1
committed=false
headers=[
cache-control=no-cache, no-store, max-age=0, must-revalidate
pragma=no-cache
expires=Fri, 01 Jan 1990 00:00:00 GMT
date=Tue, 14 Jul 2015 21:19:49 GMT
vary=X-Origin
content-type=text/html; charset=UTF-8
x-content-type-options=nosniff
x-frame-options=SAMEORIGIN
x-xss-protection=1; mode=block
server=GSE
alternate-protocol=443:quic,p=1
accept-ranges=none
transfer-encoding=chunked]
)
如果我将请求更改为ping,例如google.com相反,它按预期工作。我在这里错过了什么?我的工作curl
和损坏的<flow>
之间的不匹配是什么?
答案 0 :(得分:0)
404找不到意味着它确实连接了某个地方并得到了404响应。
因此,从网络角度来看,您的电话实际上是成功的。
所以代码基本上可行。它可能像David建议的Header问题,如user-agent错误或IP /域调用错误,或执行请求的Mule节点有一些自定义代理配置或类似。但是你的#34;代码声明不起作用,我不确定,代码实际上是有效的,看起来配置是不起作用的。