Solution to Error 400. The request has an invalid header name

I encountered this problem today, and then Searched baidu, Bing and Google. I saw many blogs that wrote about this problem. To be honest, it was not helpful at all, so I spent 2 hours to find the reason by myself. The reason for this error is very simple. The reason for this error is that the header part is wrong. may be the direct cause of the error, as some browsers have different formats, which may lead to extra white space in the header information when you paste it into the code
I’m copying and pasting this piece of code when I add header information, is that okay?But if you look closely at the content-type part, isn’t there a lot of space?Just delete the Spaces and you’re done.
 
I modified

Crawl out of the data perfectly.
 
The first blog in my life, I hope you will pay more attention to me, I will continue to publish the blog about crawler in the future!!
 

Read More: