# 获取 HTTP 应用配置

# 简介

获取 HTTP 应用配置

# Uri
GET /admin-api/applications/http/{app-id}/config
# 请求示例
# Shell
curl \
  -H "API-token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  http://{admin-site}/admin-api/applications/http/1/config
# 响应示例
Status: 200 OK
{
    "status": 0,
    "data": {
        "limiter": {
            "check_post_args_type": true,
            "max_uri_args": 100,
            "max_req_headers": 100,
            "max_post_args": 120
        },
        "enable_websocket": false,
        "enable_gzip": 0, // 0: use global gzip config; 1: enable app gzip config; 2: disable app gzip config
        "proxy_cache_revalidate": 0, // 0: use global config; 1: enable; 2: disable
        "client_max_body_size": 100,
        "client_max_body_size_unit": "m", // unit: k/m
        "proxy_cache_use_stale": ["error", "timeout", "invalid_header", "updating", "http_500", "http_502", "http_503", "http_504", "http_403", "http_404", "http_429"],
        "access_log": {
            "filename": "access.log",
            "format": 1
        }
    }
}

# 修改 HTTP 应用配置

# 简介

修改 HTTP 应用配置

# Uri
PUT /admin-api/applications/http/{app-id}/config
# Json body 参数
{
    "enable_gzip": 0, // 0: use global config; 1: enable; 2: disable
    "enable_websocket": false,
    "proxy_cache_revalidate": 0, // 0: use global config; 1: enable; 2: disable
    "client_max_body_size": 100,
    "client_max_body_size_unit": "m", // unit: k/m
    "proxy_cache_use_stale": ["error", "timeout", "invalid_header", "updating", "http_500", "http_502", "http_503", "http_504", "http_403", "http_404", "http_429"],
    "limiter": {
        "check_post_args_type": true,
        "max_uri_args": 100,
        "max_post_args": 100,
        "max_req_headers": 100
    },
    "access_log": {
        "format": 1, // format id from global log format
        "filename": "access.log"
    }
}
# 请求示例
# Shell
curl -X PUT \
  -H "API-token: 1df87165-3593-4eca-a910-9ac20005e6ec" \
  http://{admin-site}/admin-api/applications/http/1/config \
  -d '{"limiter":{"check_post_args_type":true,"max_uri_args":100,"max_req_headers":100,"max_post_args":100},"enable_websocket":false,"enable_gzip":0,"access_log":{"filename":"access.log","format":1}}'

# 响应示例
Status: 200 OK
{"status":0}