Skip to content

With version 0.27.1 the request header will be lost, while 0.27.0 will not #4858

Closed
@yangqixin123

Description

When sending a post request using version 0.27.1, the request header will be lost, but 0.27.0 will not
It is written as follows:

class Header {};
let myHeaders = new Header();
myHeaders["X-Foo"] = "bar";
myHeaders["X-Test"] = "test";
myHeaders["X-Time"] = Date.now();
  
axios.post('http://cors-test.appspot.com/test', { name: 'foo' }, { headers: myHeaders })
.then((res) => {
       console.log('res---',res.config.headers);
 })

See test.zip for details.

Environment

  • Axios Version [0.27.1]
  • Browser [Chrome]
  • Browser Version [103.0.5060.114]
  • Node.js Version [14.14]
  • OS: [iOS 12.4]

WX20220717-225027@2x

test.zip

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions