Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8503097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:39:54+00:00 2026-06-11T01:39:54+00:00

I wrote a Http/Rest Client. The Main Problem is that i recieve some unkown

  • 0

I wrote a Http/Rest Client.

The Main Problem is that i recieve some unkown digits within the requested data.
I really don´t know where they come from..

e0b
<html>
<head>
[...]
</body>
</html>
0 

You see the e0b and the 0 at the end.
In big xml files for example i got something like this:

<sometag id="somei
2000
d"><child>
...
</child></some
2000
tag>

It is irreproducible by me.

My Code:

  // read the response status code
  boost::asio::streambuf httpStreamBufferResponse;
  boost::asio::read_until(httpSocket, httpStreamBufferResponse, "\r\n");

  // check status code and validate
  istream httpResponseIStream(&httpStreamBufferResponse);

  // temp var for version
  string sHttpVersion;
  httpResponseIStream >> sHttpVersion;

  // temp var for status code
  unsigned int uiStatusCode;
  httpResponseIStream >> uiStatusCode;

  // fetch status message and switch it
  string sStatusMessage;
  getline(httpResponseIStream, sStatusMessage);
  if(!httpResponseIStream || sHttpVersion.substr(0, 5) != "HTTP/"){
    new Note(eNotesType(ERROR), "Request Interrupt", "Invalid Request Response");
    Log::write("ERROR: Request Interrupt: Invalid Request Response");
  }
  // != 200 even means that something is not OK
  if(uiStatusCode != 200){
    this -> sHttpStatusCode = uiStatusCode;
    new Note(eNotesType(WARNING), "Request Response " 
      + boost::lexical_cast<string>(uiStatusCode), httpErrorToString.at(uiStatusCode));
    Log::write("WARNING: Request Response " 
      + boost::lexical_cast<string>(uiStatusCode) + ": " + httpErrorToString.at(uiStatusCode));
  }

  // Read the response headers, which are terminated by a blank line.
  boost::asio::read_until(httpSocket, httpStreamBufferResponse, "\r\n\r\n");

  // Process the response header
  stringstream responseSStream;
  string responseSHeader;
  while (getline( httpResponseIStream, responseSHeader ) && responseSHeader != "\r" ) {
    responseSStream << responseSHeader;
  }
  // store header in member variable
  this -> sHttpResponseHeader = sHttpVersion + " " + boost::lexical_cast<string>(uiStatusCode) + " " 
    + httpErrorToString.at(uiStatusCode) + "\n" + responseSStream.str();

  // read until EOF and writing data to output as we go.
  ostringstream responseOSStream;
  while(boost::asio::read(httpSocket, httpStreamBufferResponse, boost::asio::transfer_at_least(1), error)){
    responseOSStream << &httpStreamBufferResponse;
  }

  // store content in member variable
  this -> sHttpResponseContent = responseOSStream.str();

  // if there is no EOF
  if(error != boost::asio::error::eof){ 
    new Note(eNotesType(ERROR), "Request Interrupt", "Invalid Response End");
    Log::write("ERROR: Request Interrupt: Invalid  Response End");    
  }

// catch not known exceptions properly
} catch (exception& e){
  string exceptionMessage = e.what();
  new Note(eNotesType(ERROR), "Exception", exceptionMessage);
  Log::write("ERROR: Exception: " + exceptionMessage);    
}

// log http standby
Log::write("http status: standby");

It would be a great pleasure if anybody got ANY idea where this come from..?!

My nerves are on edge..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T01:39:56+00:00Added an answer on June 11, 2026 at 1:39 am

    Your code is claiming HTTP/1.1 compliance and doesn’t actually comply with HTTP/1.1’s requirements. Either don’t claim HTTP/1.1 compliance or make sure your code does everything the standard says a client must do.

    All HTTP/1.1 applications MUST be able to receive and decode the “chunked” transfer-coding, and MUST ignore chunk-extension extensions they do not understand. — HTTP/1.1 specification, section 3.6.1

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://ideone.com/u0bVy the link above contain the code that i wrote for a class project.I
I've had this REST Server (written by myself) that is secured by simple HTTP
I have to write a client (in C++) that consumes REST apis of a
i wrote one method for getting details.in rest client getting response like this. <string
Take a look on this code, what I wrote: http://pastebin.com/TZpUAWpA , and this jQuery,
I originally wrote my Wordpress 3.0 widget http://codex.wordpress.org/Widgets_API for editing on the widget page
I followed this tutorial http://www.vogella.com/articles/AndroidCloudToDeviceMessaging/article.html I wrote the manifest File giving all the permissions
I wrote a sliding list for a project. Here it is: http://study-wise.appspot.com/test/left_right.html I have
I copied this code (in spanish) http://www.elrincondelc.com/nuevorincon/index.php?pag=codigos&id=4 and wrote a new one. This is
On a mountpoint (specifically: /var/data/) I have mounted a 3tb raid partition that stores

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.