Skip to main content

Definition

Assembly: CloudNimble.Breakdance.DotHttp.dll Namespace: CloudNimble.Breakdance.DotHttp.Models Inheritance: System.Object

Syntax

CloudNimble.Breakdance.DotHttp.Models.DotHttpRequest

Summary

Represents a single HTTP request parsed from a .http file.

Remarks

Supports all standard HTTP methods, request chaining via response variable references, file-based request bodies, and request-level variable overrides.

Examples

# @name GetUsers
GET {{baseUrl}}/users
Accept: application/json
Authorization: Bearer {{login.response.body.$.token}}

Constructors

.ctor

Syntax

public DotHttpRequest()

.ctor Inherited

Inherited from object

Syntax

public Object()

Properties

Body

Gets or sets the request body content for POST, PUT, and PATCH requests.

Syntax

public string Body { get; set; }

Property Value

Type: string

Remarks

May contain references that are resolved at runtime. For file references, this will be null and DotHttpRequest.BodyFilePath will be set.

BodyFilePath

Gets or sets the file path for request body when using file reference syntax.

Syntax

public string BodyFilePath { get; set; }

Property Value

Type: string

Examples

POST {{baseUrl}}/upload
Content-Type: application/octet-stream

< ./path/to/file.bin

Remarks

When set, the body content should be loaded from this file path at runtime. The path is relative to the .http file location.

Comments

Gets or sets the comments and documentation that appeared before this request.

Syntax

public System.Collections.Generic.List<string> Comments { get; set; }

Property Value

Type: System.Collections.Generic.List<string>

Remarks

Comments are parsed from lines starting with # or // that precede the request line. The comment markers are preserved for accurate representation.

DependsOn

Gets or sets the names of requests this request depends on for chaining.

Syntax

public System.Collections.Generic.List<string> DependsOn { get; set; }

Property Value

Type: System.Collections.Generic.List<string>

Examples

// A request using {{login.response.body.$.token}} would have "login" in DependsOn

HasResponseReferences

Gets a value indicating whether this request references variables from previous responses.

Syntax

public bool HasResponseReferences { get; set; }

Property Value

Type: bool

Examples

// True when the request contains syntax like {{login.response.body.$.token}}

Headers

Gets or sets the request headers as key-value pairs.

Syntax

public System.Collections.Generic.Dictionary<string, string> Headers { get; set; }

Property Value

Type: System.Collections.Generic.Dictionary<string, string>

Remarks

Headers are stored with case-insensitive keys per RFC 7230. Header values may contain references that are resolved at runtime.

HttpVersion

Gets or sets the HTTP version (HTTP/1.1, HTTP/2, HTTP/3).

Syntax

public string HttpVersion { get; set; }

Property Value

Type: string

Remarks

Optional. When not specified, the default HTTP version is used.

IsFileBody

Gets a value indicating whether the request body should be loaded from a file.

Syntax

public bool IsFileBody { get; }

Property Value

Type: bool

LineNumber

Gets or sets the line number in the source file where this request begins.

Syntax

public int LineNumber { get; set; }

Property Value

Type: int

Remarks

Used for diagnostics and error reporting.

Method

Gets or sets the HTTP method (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, TRACE, CONNECT).

Syntax

public string Method { get; set; }

Property Value

Type: string

Name

Gets or sets the optional name for the request, parsed from ”# @name RequestName” comment.

Syntax

public string Name { get; set; }

Property Value

Type: string

Remarks

Used for generating test method names and for referencing in request chaining.

SeparatorTitle

Gets or sets the text that appeared after the ### separator on the same line.

Syntax

public string SeparatorTitle { get; set; }

Property Value

Type: string

Examples

### Get All Users
GET {{baseUrl}}/users

Remarks

This text is used for generating descriptive test method names when @name is not specified.

Url

Gets or sets the request URL.

Syntax

public string Url { get; set; }

Property Value

Type: string

Remarks

May contain references that are resolved at runtime.

Variables

Gets or sets the request-level variables that override file-level variables.

Syntax

public System.Collections.Generic.Dictionary<string, string> Variables { get; set; }

Property Value

Type: System.Collections.Generic.Dictionary<string, string>

Examples

@baseUrl = https://override.example.com
GET {{baseUrl}}/users

Remarks

Variables defined after a request separator (###) but before the next request line apply only to that request and override file-level variables with the same name.

Methods

Equals Inherited Virtual

Inherited from object

Syntax

public virtual bool Equals(object obj)

Parameters

NameTypeDescription
objobject?-

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

public static bool Equals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

ReferenceEquals Inherited

Inherited from object

Syntax

public static bool ReferenceEquals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?