---
title: "Discussion on \"C# Tip: use the Ping class instead of an HttpClient to ping an endpoint\" | Hashnode"
description: "Discussion on \"C# Tip: use the Ping class instead of an HttpClient to ping an endpoint\". Sometimes you need to ping some endpoints. Don't rely on HttpClient, but use the native Ping class."
url: "https://hashnode.com/posts/c-tip-use-the-ping-class-instead-of-an-httpclient-to-ping-an-endpoint/62dfdef5790e138f3d39964f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [C# Tip: use the Ping class instead of an HttpClient to ping an endpoint](https://code4it.hashnode.dev/c-tip-use-the-ping-class-instead-of-an-httpclient-to-ping-an-endpoint?utm_source=hashnode&utm_medium=feed)

Sometimes you need to ping some endpoints. Don't rely on HttpClient, but use the native Ping class.

Jul 26, 2022 · 2 min read · code4it.hashnode.dev  
Read the article

-   [#csharp](https://hashnode.com/tag/csharp)

## Written by

[Davide Bellone](https://hashnode.com/@davidebellone)

@davidebellone · Turin, Italy

  
[View profile](https://hashnode.com/@davidebellone)

Principal backend developer | Content Creator | Microsoft MVP

I’m a Principal Backend Developer with more than 10 years of professional experience. I’ve been working with Microsoft platforms and frameworks since 2014. I’ve worked with many tools and frameworks, such as Azure, MongoDB, Docker, and, of course, .NET and C#. I love learning new things, and I think that the best way to learn is to share: that’s why I started my journey as a content creator and conference speaker.

## Responses 1

Markdown supported · ⌘↵ to post

[C0deR4t](https://hashnode.com/@C0deR4t)

[Jul 27, 2022](https://hashnode.com/posts/c-tip-use-the-ping-class-instead-of-an-httpclient-to-ping-an-endpoint/62dfdef5790e138f3d39964f/comment/62e1b1f2d15a9fb24e514c6a)

It's important to know that many websites / environments turn off ICMP replies (replying to PING commands). If the host refuses to reply to your echo/ping request it might seem like the host is down when in actual fact it is up but does not support the use of PING

Other than that, great article, enjoyable read 🐼

[Davide Bellone](https://hashnode.com/@davidebellone)

[Jul 28, 2022](https://hashnode.com/posts/c-tip-use-the-ping-class-instead-of-an-httpclient-to-ping-an-endpoint/62dfdef5790e138f3d39964f/comment/62e1b1f2d15a9fb24e514c6a#reply-62e2373ad15a9fb24e515dd0)

I've never understood why they turn off ICMP.

BTW in some environments, such as the Azure Portal, you can use the `tcpping` command ([here, in an old article](https://www.code4it.dev/blog/tcpping-azure-portal))
