question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DELETE strips off content-type header

See original GitHub issue

#### Summary

When sending DELETE requests, Content-Type header is not present even though manually set.

I think it has something to do with two things:

  1. https://github.com/mzabriskie/axios/blob/master/lib/adapters/xhr.js#L121-L123
  2. https://github.com/mzabriskie/axios/issues/897

#### Context

  • axios version: e.g.: v0.15.3
  • Environment: e.g.: node v7.6.4, chrome 60.0.3112.113, Mac 10.12

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:17
  • Comments:17

github_iconTop GitHub Comments

7reactions
Ruplahlavacommented, Feb 2, 2018

Any update here? I have the same issue. The rest api i am contacting allows two types of content type and i need to set it.

5reactions
whiteb38commented, Dec 20, 2018

was having this issue also, this works for me: .delete(url, { headers: { "Content-Type": "application/json" }, data: JSON.stringify(data) })

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove Content type header when making an http request
PS: I understand what is multipart-form data. I just need to strip off that header. angularjs · http · http-headers.
Read more >
HttpClient: How to Remove Charset From Content-Type Header
Solution is simple - we can create StringContent with whatever encoding and then set charset to empty string. ... This removes the charset ......
Read more >
HttpClient: How to remove charset from ... - Gunnar Peipman
Here is how I got charset definition away from Content-Type header. ... This removes charset definiton from request content type header.
Read more >
How to remove the Header on different pages in ... - YouTube
How to manually remove the headersHow to remove the headers differentlyHOw to remove the header from the cover pageHow to remove the header...
Read more >
How do I remove a server-added header from proxied location?
security-headers.conf. add_header Referrer-Policy same-origin; add_header X-Frame-Options SAMEORIGIN; add_header X-Content-Type-Options nosniff ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found