# HTTP Configuration API

The HTTP Configuration API allows Nexus Repository customers to manage the outbound HTTP settings.

Review the [HTTP and HTTPS Request and Proxy Settings](https://help.sonatype.com/en/http-request-and-proxy-settings.html "HTTP Request and Proxy Settings") documentation for details.

## Default HTTP Settings in Nexus Repository

The default outbound HTTP settings in Nexus Repository are as follows:

| Setting | Default Value | Description |
| --- | --- | --- |
| **Connection/Socket Retry Attempts** | 2 | The number of times Nexus Repository will automatically retry a request to a remote server if the initial request fails. |
| **Connection/Socket Timeout** | 30 seconds | The maximum amount of time that Nexus Repository waits when establishing an initial connection to a remote server. |
| **Request Timeout** | 20 seconds | After Nexus Repository has established an initial connection with a remote server, the Request Timeout configuration controls the amount of time Nexus Repository will wait for a response to a specific request. |
| **Keep Alive Duration** | 30 seconds | Property sets how long to keep connections open for reuse. |
| **Buffer Size** | 8k bytes | The maximum number of bytes that can be buffered when reading or writing a response or request content. |

## [Get HTTP Settings](https://help.sonatype.com/en/http-configuration-api.html#get-http-settings_body)

This request returns a list of outbound HTTP settings. The user requires the following permissions: (`nexus:settings:read`)

```
GET /service/rest/v1/http
```

Example

```
curl -u admin:admin123 -X GET http://localhost:8081/service/rest/v1/http
```

The returned password fields are redacted for security.

## [Update HTTP Settings](https://help.sonatype.com/en/http-configuration-api.html#update-http-settings_body)

Send the configuration to update the outbound HTTP settings. The user requires the following permissions: (`nexus:settings:update`)

```
PUT /service/rest/v1/http
```

The request requires the body parameter with the values to be set.

```
Example ValueModel{
  "nonProxyHosts": [\
    "string"\\
  ],
  "userAgent": "string",
  "timeout": 3600,
  "retries": 10,
  "httpProxy": {
    "enabled": true,
    "host": "string",
    "port": "string",
    "authInfo": {
      "enabled": true,
      "username": "string",
      "password": "string",
      "ntlmHost": "string",
      "ntlmDomain": "string"
    }
  },
  "httpsProxy": {
    "enabled": true,
    "host": "string",
    "port": "string",
    "authInfo": {
      "enabled": true,
      "username": "string",
      "password": "string",
      "ntlmHost": "string",
      "ntlmDomain": "string"
    }
  }
}
```

## [Delete HTTP Settings](https://help.sonatype.com/en/http-configuration-api.html#delete-http-settings_body)

Deletes the outbound HTTP settings. The user requires the following permissions: (`nexus:settings:update`)

```
DELETE /service/rest/v1/http
```

Example

```
curl -u admin:admin123 -X DELETE http://localhost:8081/service/rest/v1/http
```

The response returns a 204 when successful.
