Giter VIP home page Giter VIP logo

Comments (12)

hzr1348 avatar hzr1348 commented on August 22, 2024

版本1.1.6

from webapiclient.

hzr1348 avatar hzr1348 commented on August 22, 2024

采用github上下载的demo进行测试

from webapiclient.

hzr1348 avatar hzr1348 commented on August 22, 2024

[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.

hzr1348 avatar hzr1348 commented on August 22, 2024

当httphost地址不存在时报错

from webapiclient.

hzr1348 avatar hzr1348 commented on August 22, 2024

具体错误代码,返回值为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.

hzr1348 avatar hzr1348 commented on August 22, 2024

期待返回地址未找到相关信息,比如状态码404

from webapiclient.

hzr1348 avatar hzr1348 commented on August 22, 2024

如果包含具体的返回类型,为NULL时,参考返回值,default(TEntity)

from webapiclient.

xljiulang avatar xljiulang commented on August 22, 2024

那你在ApiReturnAttribute的行31下断看看,context.ResponseMessage对象是否为NULL。

from webapiclient.

hzr1348 avatar hzr1348 commented on August 22, 2024

为NULL,我服务的宿主机没开。Response没有返回值

from webapiclient.

hzr1348 avatar hzr1348 commented on August 22, 2024
  •   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.

yang-xiaodong avatar yang-xiaodong commented on August 22, 2024

@hzr1348 请一次性将问题描述清楚,避免频繁打扰订阅用户。另外请注意一下issue的格式

from webapiclient.

xljiulang avatar xljiulang commented on August 22, 2024

@hzr1348
我签出1.16的代码,在各框架下运行,没有重现这个问题。
你把你现在修改的代码打包,在群里发给我调试看看。

from webapiclient.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.