---
title: "W5100s - Difference between HTTP request using cURL and a web browser?"
url: "https://maker.wiznet.io/forum/15030"
markdown_url: "https://maker.wiznet.io/forum/15030/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "Jorge Lopez"
created: "2023-09-29T08:16:34+09:00"
last_activity: "2023-09-29T08:16:34+09:00"
language: "en"
views: 341
replies: 0
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5100s - Difference between HTTP request using cURL and a web browser?

## Question

Asked by Jorge Lopez on 2023-09-29 in Ethernet Chips.

I have an HTTP server running based on the following example: [RP2040-HAT-C/examples/http/server/w5x00_http_server.c at main · Wiznet/RP2040-HAT-C · GitHub](https://github.com/Wiznet/RP2040-HAT-C/blob/main/examples/http/server/w5x00_http_server.c).

When I make a request using a web browser, for example, Firefox or even a command-line based browser like `links`, I get a correct response from the server every time. It also works well if using Postman for testing. However, if I use `cURL`, every other call will get `curl: (52) Empty reply from server`.

Is there any underlying difference between an application doing an HTTP request and a simpler command line tool doing the same?

Furthermore, from the server logs, I realized that:

- **Firefox**: receives all responses correctly, and there’s only one socket connected per request.

- **Links**: receives all responses correctly, and there are two sockets connected per request.

- **cURL**: fails to receive a response every other call, and there’s only one socket connected per request.

In order to get the very same response I went to the network analyzer in Firefox and copied the `HTTP` request from there so that the exact same headers are used. I verified from the logs that the payload the server received is always the same when running Firefox and `cURL`.

I analyzed the payload that the server receives and it’s exactly the same. However, I found out that when using `cURL` the socket register status changes before finishing the complete response from socket `ESTABILISHED` to `CLOSE_WAIT`. Therefore, the socket process doesn’t complete since it never reaches the `DONE` status, and it requires another request where instead of processing the request it just closes the previous pending operation. When I use Firefox or anything else, this doesn’t happen and everything works normal, as expected.

What else could be affecting the behavior?

---

Source: https://maker.wiznet.io/forum/15030
