[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Pulling data from a server using HTTP with lwIP
From: |
Mikael Eiman |
Subject: |
Re: [lwip-users] Pulling data from a server using HTTP with lwIP |
Date: |
Thu, 13 Nov 2014 14:10:46 +0100 |
For the HTTP basics, have a look at
http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5
(Ok, not the most recent version of the spec, but this bit is still valid)
Notably, this is a minimum valid request for HTTP/1.1:
GET /pub/WWW/TheProject.html HTTP/1.1
Host: www.w3.org
<empty line>
You must provide a Host header, and end the headers with an empty line. For
HTTP/1.0 you can omit the Host header, if you have to.
regards,
Mikael
> 13 nov 2014 kl. 13:52 skrev Robert Wood <address@hidden>:
>
> Well, I am certainly no expert on HTTP, *but*, if I look at how things work
> with my computer, when it requests a packet from my board there is only the
> SYN, SYN ACK, ACK handshake before the computer sends the GET command.
>
> Now, when my board is the client, the issue I have is not [yet] whether the
> GET is working properly.
>
> What is happening when lwIP board is client and desktop is server:
>
> If I establish a connection from the board to the desktop and do not send a
> GET request, then lwIP does the SYN, SYN ACK, ACK handshake just fine.
>
> If I add the [potentially incorrect] GET request, the SYNN is sent, the SYN
> ACK is received, but my board running lwIP does not send the ACK out to the
> desktop.
>
> You may well be totally correct that my GET line is incomplete, I cannot find
> any details on exactly how it should be, but I don't think that is the main
> issue at the moment. I'm happy to be told I'm talking nonsense though.
>
> Thanks!
>
>
>
> On 13/11/14 11:21, Simon Goldschmidt wrote:
>> Robert Wood wrote:
>>> Hmmmm. I seem to be wrong, It *does* send out the ACK. I took out these
>>> lines:
>>> strcpy(GetString,"GET /index.html HTTP/1.1\r\n");
>>> netconn_write(xNetConn,GetString,sizeof(GetString),NETCONN_NOCOPY);
>>
>> As you seem to be trying to implement a HTTP client: are you familiar with
>> the HTTP protocol? I'm not sure the single line is enough for HTTP 1.1 (it
>> should be for 0.9), but at least you need a double line-break to inform the
>> server that this is the end of the HTTP header.
>>
>> I'd suggest reading a bit more on HTTP.
>>
>> Simon
>>
>> _______________________________________________
>> lwip-users mailing list
>> address@hidden
>> https://lists.nongnu.org/mailman/listinfo/lwip-users
>>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-users
smime.p7s
Description: S/MIME cryptographic signature
- Re: [lwip-users] Pulling data from a server using HTTP with lwIP, (continued)
- Re: [lwip-users] Pulling data from a server using HTTP with lwIP, Robert Wood, 2014/11/13
- Re: [lwip-users] Pulling data from a server using HTTP with lwIP, Simon Goldschmidt, 2014/11/13
- Re: [lwip-users] Pulling data from a server using HTTP with lwIP, Robert Wood, 2014/11/13
- Re: [lwip-users] Pulling data from a server using HTTP with lwIP, Simon Goldschmidt, 2014/11/13
- Re: [lwip-users] Pulling data from a server using HTTP with lwIP, Robert Wood, 2014/11/13
- Re: [lwip-users] Pulling data from a server using HTTP with lwIP, Simon Goldschmidt, 2014/11/13
- Re: [lwip-users] Pulling data from a server using HTTP with lwIP, Robert Wood, 2014/11/13
- Re: [lwip-users] Pulling data from a server using HTTP with lwIP, Simon Goldschmidt, 2014/11/13
- Re: [lwip-users] Pulling data from a server using HTTP with lwIP, Robert Wood, 2014/11/13
- Re: [lwip-users] Pulling data from a server using HTTP with lwIP, Robert Wood, 2014/11/13
- Re: [lwip-users] Pulling data from a server using HTTP with lwIP,
Mikael Eiman <=