# Sometimes curl returns nothing, but page comes up in browser

**URL:** <https://boards.straightdope.com/t/sometimes-curl-returns-nothing-but-page-comes-up-in-browser/973965>\
**Category:** Factual Questions\
**Created:** [October 29, 2022, 1:36pm UTC](https://boards.straightdope.com/t/sometimes-curl-returns-nothing-but-page-comes-up-in-browser/973965 "2022-10-29T13:36:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CookingWithGas](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/cookingwithgas/32/485_2.png) [@CookingWithGas](https://boards.straightdope.com/u/CookingWithGas)\
**Post date:** [October 29, 2022, 1:36pm UTC](https://boards.straightdope.com/t/sometimes-curl-returns-nothing-but-page-comes-up-in-browser/973965/1 "2022-10-29T13:36:20Z")

</div>

I have used curl to get a preview of code for web pages I think might be dicey. Sometimes nothing comes back, though a page will come up if I open the URL in a browser. I haven’t tried to look at the header that curl sends, so I don’t know what browser it identifies. Can a server determine if the request comes from curl and then decline to serve a page?

---

<div class="post-metadata">

**Author:** ![FinsToTheLeft](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/finstotheleft/32/2930_2.png) [@FinsToTheLeft](https://boards.straightdope.com/u/FinsToTheLeft)\
**Post date:** [October 29, 2022, 2:01pm UTC](https://boards.straightdope.com/t/sometimes-curl-returns-nothing-but-page-comes-up-in-browser/973965/2 "2022-10-29T14:01:31Z")

</div>

Yes, it looks at the user-agent which by default identifies curl as the requester. You can change it if you like.

> **[How to Change or Set User Agent with curl {Several Methods Explained}](https://phoenixnap.com/kb/curl-user-agent)**
>
> Set or change the user agent string with curl with a simple command. Change the user agent to the wanted browser to access any webpage.

---

<div class="post-metadata">

**Author:** ![CookingWithGas](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/cookingwithgas/32/485_2.png) [@CookingWithGas](https://boards.straightdope.com/u/CookingWithGas)\
**Post date:** [October 29, 2022, 2:18pm UTC](https://boards.straightdope.com/t/sometimes-curl-returns-nothing-but-page-comes-up-in-browser/973965/3 "2022-10-29T14:18:29Z")

</div>

Nailed it. Thanks very much!

---

<div class="post-metadata">

**Author:** ![FinsToTheLeft](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/finstotheleft/32/2930_2.png) [@FinsToTheLeft](https://boards.straightdope.com/u/FinsToTheLeft)\
**Post date:** [October 29, 2022, 2:32pm UTC](https://boards.straightdope.com/t/sometimes-curl-returns-nothing-but-page-comes-up-in-browser/973965/4 "2022-10-29T14:32:33Z")

</div>

Glad I could help.
