Giter VIP home page Giter VIP logo

Comments (5)

getActivity avatar getActivity commented on June 9, 2024
image image

小伙子,确定这个参数不是你自己加上的?

from easyhttp.

GuoLiangjun123 avatar GuoLiangjun123 commented on June 9, 2024

image image
小伙子,确定这个参数不是你自己加上的?

不是呀,这两个参数我是加在请求头里面的

from easyhttp.

getActivity avatar getActivity commented on June 9, 2024
image

from easyhttp.

getActivity avatar getActivity commented on June 9, 2024

@GuoLiangjun123 小伙子,你的代码不是写得很明显了?你把 params.params 对象传给 headerEncode 方法了,对应的 headerEncode 方法里面 dic 参数,然后你判断 dic 是否为空,如果为空就用 mutableMapOf 扩展函数创建,但是很显然,结果不为空,所以直接就复用了 dic 参数,signDic 直接就等于 dic,然后你给 dic 赋值了两个键值对,这才导致的请求里面也有参数。

from easyhttp.

GuoLiangjun123 avatar GuoLiangjun123 commented on June 9, 2024

@GuoLiangjun123 小伙子,你的代码不是写得很明显了?你把 params.params 对象传给 headerEncode 方法了,对应的 headerEncode 方法里面 dic 参数,然后你判断 dic 是否为空,如果为空就用 mutableMapOf 扩展函数创建,但是很显然,结果不为空,所以直接就复用了 dic 参数,signDic 直接就等于 dic,然后你给 dic 赋值了两个键值对,这才导致的请求里面也有参数。

所以说这里如果不想增加多余的请求参数就不能直接将dic赋值给signDic,而是应该重新创建一个headerMap,将dic的值映射给这个新的headerMap新的对象!

from easyhttp.

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.