> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# HttpEndpointAttribute

> Specifies that a configuration property represents an HTTP endpoint URL for an HttpClient.  Used by the EasyAF configuration system to automatically register...

## Definition

**Assembly:** CloudNimble.EasyAF.Configuration.dll

**Namespace:** CloudNimble.EasyAF.Configuration

**Inheritance:** System.Attribute

## Syntax

```csharp theme={"dark"}
CloudNimble.EasyAF.Configuration.HttpEndpointAttribute
```

## Summary

Specifies that a configuration property represents an HTTP endpoint URL for an HttpClient.
Used by the EasyAF configuration system to automatically register HttpClients with their base addresses.

## Remarks

This attribute enables automatic HttpClient registration by linking configuration properties
that contain URLs to the corresponding HttpClient name properties. The configuration system
uses this information to set up named HttpClient instances with appropriate base addresses.

## Examples

```csharp theme={"dark"}
public class MyConfiguration : ConfigurationBase
{
    public string MyApiClientName { get; set; } = "MyApiClient";

    [HttpEndpoint(nameof(MyApiClientName))]
    public string MyApiRoot { get; set; } = "https://api.example.com";
}

// This will automatically register an HttpClient named "MyApiClient"
// with base address "https://api.example.com"
```

## Constructors

### <Icon icon="hammer" iconType="duotone" color="#E0EC32" size={24} className="mr-2" /> .ctor

Initializes a new instance of the [HttpEndpointAttribute](/api-reference/CloudNimble/EasyAF/Configuration/HttpEndpointAttribute) class.

#### Syntax

```csharp theme={"dark"}
public HttpEndpointAttribute(string clientNameProperty)
```

#### Parameters

| Name                 | Type     | Description                                                                  |
| -------------------- | -------- | ---------------------------------------------------------------------------- |
| `clientNameProperty` | `string` | The name of the property that contains the HttpClient name for registration. |

#### Exceptions

| Exception               | Description                               |
| ----------------------- | ----------------------------------------- |
| `ArgumentNullException` | Thrown when *clientNameProperty* is null. |

## Properties

### <Icon icon="tag" iconType="duotone" color="#E0EC32" size={24} className="mr-2" /> ClientNameProperty

Gets or sets the name of the property that contains the HttpClient name to be registered.
This property should contain the string value that will be used as the named HttpClient identifier.

#### Syntax

```csharp theme={"dark"}
public string ClientNameProperty { get; set; }
```

#### Property Value

Type: `string`
