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 9252515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:57:50+00:00 2026-06-18T10:57:50+00:00

I was wondering if there was a trick to this I was missing. On

  • 0

I was wondering if there was a trick to this I was missing.

On an arduino you do a Get from a web service thusly:

if (client.connect("google.com", 80)) {
client.println("GET /service/v2/time HTTP/1.1");
client.println("Host:nimbits-02.appspot.com");   
client.println();
delay(1000);
while(client.connected() && !client.available()) delay(1); 
while (client.available()) {
  c = client.read();
  Serial.print(c);
}

client.stop();
client.flush();

}

Works perfectly fine (calling the nimbits time service)

The content body of this call is what I need, printing the result as above give me:

> HTTP/1.1 200 OK Date: Sat, 02 Feb 2013 17:24:38 GMT Content-Type:
> text/html Server: Google Frontend Content-Length: 13
> 
> 1359825878036

All perfectly good – but I have to do some expensive string processing on the arduino to get the message body. I just want 1359825878036. Is there a way to tell the ethernet client to not read the headers? That would be handy.

my best solution so far is to assume the message body is always after the last new line char, which seems error prone:

if (client.connect("google.com", 80)) {
      client.println("GET /service/v2/time HTTP/1.1");
      client.println("Host:nimbits-02.appspot.com");   
      client.println();
      delay(1000);
      while(client.connected() && !client.available()) delay(1); 
      while (client.available()) {
        c = client.read();
        response= response + c;
      }
     int contentBodyIndex = response.lastIndexOf('\n');
     if (contentBodyIndex > 0) {
        Serial.print(response.substring(contentBodyIndex));
     }

      client.stop();
      client.flush();
    }

Thanks, Ben – nimbits.com

  • 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-18T10:57:52+00:00Added an answer on June 18, 2026 at 10:57 am

    Their is a key. The headers end at a double CRLF:

    Response = Status-Line
        *(( general-header        
       | response-header        
       | entity-header ) CRLF)  
       CRLF
       [ message-body ]   
    

    see W3 doc

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

Sidebar

Related Questions

Wondering if there is any way to get the lambda expressions that result from
Just wondering if there is any way to get the NS records in C#.
This post might be more theory than code. I was wondering if there is
I'm wondering if there is some trick to keep a file in the repository
I was wondering if there was a way to stop a page from parsing
I'm wondering if there are any libraries to read live MIDI input from a
Wondering if there's any trick to accessing a nested control in the code-behind ?
I was wondering whether there is a trick to (easily) incorporate some python code
I'm just wondering if there's a better way of doing this in SQL Server
I am wondering if there are any tips or tricks to converting perl into

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.