Skip to main content
2 of 4
added 64 characters in body; edited tags
Glorfindel
  • 6.9k
  • 3
  • 22
  • 49

400 - Bad Request - Invalid URL errors with HTML response

Since a few weeks, I'm getting 400 - Bad Request errors now and then, on pretty standard API calls like fetching post details. This is the response I get:

<DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request - Invalid URL</h2>
<hr><p>HTTP Error 400. The request URL is invalid.</p>
</BODY></HTML>

which leads me to believe something is wrong on the server side; normally, a 'real' bad request is met with a JSON response, like here.

I got that this morning for a GET call to

https://api.stackexchange.com/2.2/answers/3379083;3479797;3485080;3532536;3588593;3707741;3774262;3897582;3956977;4146496;4216746;4252051;4325734;4328661;4422405;4454080;4576180;4579476;4662930;4669874;4800981;4830891;4966813;4983149;5007784;5079482;5094418;5098217;5113940;5207041;5223793;5289474;5320683;5384201;5394784;5398512;5411333;5414050;5476133;5483811;5487894;5571620;5658863;5665004;5723151;5750579;5785013;5785435;5875843;5893447;5893600;5919049;6163052;6163411;6210459;6337955;6385814;6402358;6489721;6686494;6770732;6866354;6908297;6966675;7054963;7215895;7220022;7222761;7251593;7255421;7336998;7422381;7543102;7604800;7628070;7701256;7701271;7706953;7707553;7815148;7829578;7886173;7905506;7910771;7917144;7957760;8103815;8131752;8249070;8283530;8304194;8325611;8373652;8397476;8403988;8460209;8509208;8528185;8543589;8547485?sort=creation&order=asc&pageSize=100&site=stackoverflow&filter=!)Q2B_A1DAAeCErOKdxRVbW2a&key=L8n*CvRX3ZsedRQicxnjIA((

I'm trying it a few times in my browser now, and it sometimes works, sometimes it doesn't. What's going on here?

There doesn't seem to be a difference between v2.2 and v2.3.

Glorfindel
  • 6.9k
  • 3
  • 22
  • 49