Table of Contents

HttpMethodConverter Class

Definition

Namespace
Cuemon.Net.Http
Assemblies
Cuemon.Net.dll
Source
src/Cuemon.Net/Http/HttpMethodConverter.cs

This utility class is designed to make HttpMethod related conversions easier to work with.

public static class HttpMethodConverter
Inheritance
object
HttpMethodConverter

Examples

The following example demonstrates how to convert a System.Net.Http.HttpMethod to the corresponding HttpMethods enum value using HttpMethodConverter. It converts the GET method and prints the result.

using System;
using System.Net.Http;
using Cuemon.Net.Http;

namespace MyApp.Examples;

public static class HttpMethodConverterExample
{
    public static void Demonstrate()
    {
        HttpMethod get = HttpMethod.Get;
        HttpMethods result = HttpMethodConverter.ToHttpMethod(get);
        Console.WriteLine(result); // Get
    }
}

Methods

Name Description
ToHttpMethod(HttpMethod)

Converts the specified method to its equivalent HttpMethods representation.