HTTP Configuration API
Note
Only available in Sonatype Nexus Repository Pro. Interested in a free trial? Start here.
The HTTP Configuration API allows Sonatype Nexus Repository Pro customers to manage the outbound HTTP settings.
Review the HTTP and HTTPS Request and Proxy Settings documentation for details.
Default HTTP Settings in Nexus Repository 3
The default outbound HTTP settings in Nexus Repository 3 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. |
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.
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" } } }
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