Skip to main content

HTTP Configuration

These CodeGen settings allow you to manage HTTP configurations in the generated SDKs.

Enable HTTP Cache

Use this setting to enable/disable HTTP caching for idempotent endpoint methods.

note

Please note that this setting is experimental and may not function properly at all times. Feel free to contact our support if you run into an issue.

Usage

To use this feature, you need to specify a Boolean type. By default, its value is set to false.

"info": {
...,
"x-codegen-settings": {
"EnableHttpCache": false
}
}

Language Support

C#JavaPHPPythonRubyTSGo
✔️✔️

Append Content Headers

Enabling this setting will automatically determine the request and response content types and append appropriate accept and content-type headers. This affects the generated SDK as well as the HTTP documentation. For example, accept: application/json and content-type: application/json headers will be appended for JSON serialization mode.

Usage

To use this feature, you need to specify a Boolean type. By default, its value is set to true.

"info": {
...,
"x-codegen-settings": {
"AppendContentHeaders": true
}
}

Language Support

C#JavaPHPPythonRubyTSGo
✔️✔️✔️✔️✔️✔️✔️

Change in API Call

You can see the change this setting has in the HTTP curl command:

Value Change
true (default)
curl -X GET -G \
--url 'http://localhost:3000/response/date' \
-H 'Accept: application/json' \
-d 'array=true'
false
curl -X GET -G \
--url 'http://localhost:3000/response/date' \
-d 'array=true'

Allow Skipping SSL Certificate Verification

This setting creates a configuration option in SDKs to optionally skip certificate verification when establishing HTTPs connections.

caution

Skipping verification of an SSL certificate is not the recommended approach as it opens the possibility of security vulnerability.

Usage

To use this feature, you need to specify a Boolean type. By default, its value is set to false.

"info": {
...,
"x-codegen-settings": {
"AllowSkippingSSLCertVerification": false
}
}

Language Support

C#JavaPHPPythonRubyTSGo
✔️✔️✔️✔️✔️

Deprecated Settings

We have marked the following settings as deprecated since we will no longer provide support for them in the future.

Throw For HTTP Error Status Codes

note

Please be careful while using this setting as it might not function as intended under all scenarios.

Disable this setting to return status code and response instead of throwing an exception for error responses.

tip

You can couple this setting with ReturnCompleteHttpResponse setting to make implementation easier.

Usage

To use this feature, you need to specify a Boolean type. By default, its value is set to true.

"info": {
...,
"x-codegen-settings": {
"ThrowForHttpErrorStatusCodes": true
}
}

Language Support

C#JavaPHPPythonRubyTSGo
✔️✔️✔️

Change in SDK

Configuring this setting has the following effect on the generated SDK:

Value Change
true (default)
function sendDeletePlainText(string $textString): ServerResponse
false
function sendDeletePlainText(string $textString): ApiResponse