2

Catching error message http_error_category::bad_reason as a result of http request via boost. What approximately does this error mean?

sehe
  • 374,641
  • 47
  • 450
  • 633
born4bits
  • 21
  • 3

1 Answers1

1

It means that parsing the reason did not succeed. E.g by unexpected end of input or illegal character data before the end of line.

The HTTP specification details the characters allowed as part of the first line of a HTTP response, and the code discloses what characters are prohibited in parse_token_to_eol.

Notable cause of this error may be when the server doesn't conform to the HTTP specification of requiring CRLF line ends (e.g. sending just '\n' instead of "\r\n")

sehe
  • 374,641
  • 47
  • 450
  • 633
  • Cheers. Welcome to [SO]. Please remember to vote/accept https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – sehe Aug 26 '21 at 14:20