Coder Social home page Coder Social logo

Comments (4)

EzrealJ avatar EzrealJ commented on August 15, 2024

你好,能否提供一个简单的demo?

from webapiclient.

EzrealJ avatar EzrealJ commented on August 15, 2024

我大致理解你是重写了AuthorizationHandler的IsUnauthorizedAsync,来覆盖HttpClient的授权状态,当前你遇到的问题是需要读取两次Body?

from webapiclient.

LGinC avatar LGinC commented on August 15, 2024

是的

from webapiclient.

EzrealJ avatar EzrealJ commented on August 15, 2024

这种设计意味着想要获取{Status: 401}必须要读取流,若考虑json中成员随机分布,Status可能出现在json的尾端,客户端由于重读的机制,性能随着报文的增大而降低,参考以下考量

  • 1、如果你的应用是性能尚可的Client角色,且返回的报文不会太长,则无需过于担心二次反序列化的成本
  • 2、如果你的应用同时也充当Server角色,即作为一个中间应用存在;首先考虑与服务端协商修改这种设计;若服务端无法修改这种设计,则考虑替换流以便其可以被重读,这样做的用处是有限的,【堆服务器配置可能收益更明显】。

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.