# HTTPService

**Noir.Services.HTTPService**: `NoirService`

A service for sending HTTP requests.

Requests are localhost only due to Stormworks limitations.

***

```lua
Noir.Services.HTTPService:_FindRequest(URL, port)
```

Get earliest request for a URL and port.

Used internally.

### Parameters

* `URL`: string
* `port`: integer

### Returns

* `NoirHTTPRequest|nil`
* `integer|nil`

***

```lua
Noir.Services.HTTPService:IsPortValid(port)
```

Returns if a port is within the valid port range.

### Parameters

* `port`: integer

### Returns

* `boolean`

***

```lua
Noir.Services.HTTPService:GET(URL, port, callback)
```

Send a GET request.

All requests are localhost only. This is a Stormworks limitation.

### Parameters

* `URL`: string
* `port`: integer
* `callback`: fun(response: - NoirHTTPResponse)|nil

### Returns

* `NoirHTTPRequest`

***

```lua
Noir.Services.HTTPService:GetActiveRequests()
```

Returns all active requests.

### Returns

* `table<integer, NoirHTTPRequest>`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cuhhub.gitbook.io/noir/api-reference/built-ins/services/httpservice.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
