# HTTP

## Get a list of HTTP records

<mark style="color:blue;">`GET`</mark> `https://api.halosecurity.com/api/v1/http/list.json`

Returns a paginated list of HTTP records.

[https://app.halosecurity.com/user/security/firewall/http/list](https://app.halosecurity.com/user/security/firewall/http/list?)

#### Query Parameters

| Name       | Type    | Description                                                              |
| ---------- | ------- | ------------------------------------------------------------------------ |
| sort       | String  | <p><code>0</code></p><p>= none (default)</p>                             |
| sort\_desc | Integer | <p><code>0</code> = No <em>(default)</em></p><p><code>1</code> = Yes</p> |
| port       | Integer | Filter by port                                                           |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "list": [
        {
            "http": {
                "html_count_js": 0,
                "headers": [
                    {
                        "date": "Sun, 06 Feb 2022 18:45:56 GMT"
                    },
                    {
                        "content-type": "text/html; charset=utf-8"
                    },
                    {
                        "content-length": "90"
                    },
                    {
                        "connection": "keep-alive"
                    },
                    {
                        "server": "Apache"
                    },
                    {
                        "set-cookie": "JSESSIONID=123; path=/"
                    }
                ],
                "code": 503,
                "target_name": "",
                "monitor_state": 1,
                "target_id": 1,
                "url": "http://www.example.com",
                "target": "www.example.com",
                "platforms": [],
                "html_count_css": 0,
                "size": 90,
                "port": 80,
                "code_detail": "Service Unavailable",
                "scope": 1,
                "risk": "none",
                "location": "http://example.com",
                "scan_id": "id1",
                "html_count_link": 0
            },
            "target": {
                "target_name": "",
                "target_id": 1,
                "target": "www.example.com"
            }
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Get the details of an HTTP record.

<mark style="color:blue;">`GET`</mark> `https://api.halosecurity.com/api/v1/http/get.json`

Returns the details of an HTTP record.

[https://app.halosecurity.com/user/security/firewall/http/list](https://app.halosecurity.com/user/security/firewall/http/list?)

#### Query Parameters

| Name                                         | Type    | Description |
| -------------------------------------------- | ------- | ----------- |
| target\_id<mark style="color:red;">\*</mark> | Integer |             |
| port<mark style="color:red;">\*</mark>       | Integer |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "success": 1,
    "http": {
        "html_count_js": 0,
        "headers": [
            {
                "date": "Sun, 06 Feb 0000 00:00:00 GMT"
            },
            {
                "content-type": "text/html; charset=utf-8"
            },
            {
                "content-length": "90"
            },
            {
                "connection": "keep-alive"
            },
            {
                "server": "Apache"
            },
            {
                "set-cookie": "JSESSIONID=abc; path=/"
            }
        ],
        "code": 503,
        "target_name": "",
        "monitor_state": 1,
        "target_id": 1,
        "url": "http://www.example.com",
        "target": "www.example.com",
        "platforms": [],
        "html_count_css": 0,
        "size": 90,
        "port": 80,
        "code_detail": "Service Unavailable",
        "scope": 1,
        "risk": "none",
        "location": "http://www.example.com",
        "scan_id": "id1",
        "html_count_link": 0
    }
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "code": 0,
    "message": "target_id required"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    "code": 0,
    "message": "scan not found"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    "code": 0,
    "message": "firewall not scanned"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    "code": 0,
    "message": "http server not found"
}
```

{% endtab %}
{% endtabs %}
