To make an HTTP HEAD request using C#, you can use the HttpWebRequest
class from the System.Net
namespace. Here's an example code snippet to make an HTTP HEAD request and get the response headers:
main.cs881 chars33 lines
In this example, the HttpWebRequest
is created and set to use the HEAD
method. Then, the request is sent using the GetResponse()
method, which returns an HttpWebResponse
object. Finally, the response headers are printed to the console using a foreach
loop.
gistlibby LogSnag