Comments (12)
版本1.1.6
from webapiclient.
采用github上下载的demo进行测试
from webapiclient.
[HttpHost("http://127.0.0.1:50001")]
[AutoReturn(EnsureSuccessStatusCode = true)]
public interface IFileApi : IHttpApiClient
{
[HttpGet("/api/v1/ZplFile/Express/{pobid}")]
ITask GetExpressLabelAsync(int pobid);
}
from webapiclient.
当httphost地址不存在时报错
from webapiclient.
具体错误代码,返回值为NULL时报错
///
/// 执行一次请求
///
///
private async Task RequestAsync()
{
var context = new ApiActionContext
{
ApiActionDescriptor = this.apiActionDescriptor,
HttpApiConfig = this.httpApiConfig,
RequestMessage = new HttpApiRequestMessage { RequestUri = this.httpApiConfig.HttpHost },
ResponseMessage = null
};
var result = await this.RequestAsync(context);
return (TResult)result;
}
from webapiclient.
期待返回地址未找到相关信息,比如状态码404
from webapiclient.
如果包含具体的返回类型,为NULL时,参考返回值,default(TEntity)
from webapiclient.
那你在ApiReturnAttribute的行31下断看看,context.ResponseMessage对象是否为NULL。
from webapiclient.
为NULL,我服务的宿主机没开。Response没有返回值
from webapiclient.
-
context {WebApiClient.Contexts.ApiActionContext} WebApiClient.Contexts.ApiActionContext
-
ApiActionDescriptor Name = "GetExpress2LabelAsync" WebApiClient.Contexts.ApiActionDescriptor
-
HttpApiConfig {WebApiClient.HttpApiConfig} WebApiClient.HttpApiConfig
-
RequestMessage {GET /api/v1/ZplFile/Express2/123 HTTP/1.1
Host: 192.168.0.8:50001
} WebApiClient.HttpApiRequestMessage
-
ResponseMessage null System.Net.Http.HttpResponseMessage
-
Tags Id = null WebApiClient.Tags
-
tags Id = null WebApiClient.Tags
from webapiclient.
@hzr1348 请一次性将问题描述清楚,避免频繁打扰订阅用户。另外请注意一下issue的格式
from webapiclient.
@hzr1348
我签出1.16的代码,在各框架下运行,没有重现这个问题。
你把你现在修改的代码打包,在群里发给我调试看看。
from webapiclient.
Related Issues (20)
- 是否支持失败重试+自定义重试策略 HOT 5
- 是否考虑支持接口转发的功能 HOT 5
- .net 7.0 Console程序怎么使用该组件? HOT 2
- .net 7.0的Console程序提示不支持将ContentType为 text/html 的内容转换为对象 HOT 3
- 生成上传文件代理时,找不到FileParameter参数。
- 参数为实体类时是否有Attribute可用于自定义字段名 HOT 4
- TimeOut action属性和Param属性 设置之后都不起作用 无论设置多少都是60秒超时 HOT 2
- WriteLog方法BUG。 HOT 2
- 如何处理超时异常 HOT 2
- 请问 HttpApiClient.Create<T>() 还支持吗? HOT 1
- 请求执行时出现SocketException,是否考虑将HttpContext也抛出
- 支持添加自定义请求头吗? HOT 5
- HttpRequestException.StatusCode 错误 HOT 3
- 重写IsUnauthorizedAsync读取Body判断Status HOT 4
- CancellationTokenTypeAttribute类变量用错了
- 如何在ApiReturnAttribute进行重发? HOT 2
- 偶尔抛出异常,原因不明,抛出异常的位置:JsonNetReturnAttribute; System.ObjectDisposedException: Cannot access a disposed object. HOT 1
- 调用的地方比较多,有办法在LoggingFilter中获取到调用的信息 HOT 1
- 使用时报了400的错误。我不太确定我哪一步出现问题 HOT 4
- 下载路径是QT6版本的,但是实际压缩包是QT5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webapiclient.