[python-nextgen] Fix binary response (#15076)

* fix binary response in python nextgen client

* update samples
This commit is contained in:
William Cheng
2023-03-31 16:16:58 +08:00
committed by GitHub
parent 05fa5601dd
commit b59d535176
36 changed files with 906 additions and 75 deletions

View File

@@ -4,10 +4,71 @@ All URIs are relative to *http://localhost:3000*
Method | HTTP request | Description
------------- | ------------- | -------------
[**test_binary_gif**](BodyApi.md#test_binary_gif) | **POST** /binary/gif | Test binary (gif) response body
[**test_echo_body_pet**](BodyApi.md#test_echo_body_pet) | **POST** /echo/body/Pet | Test body parameter(s)
[**test_echo_body_pet_response_string**](BodyApi.md#test_echo_body_pet_response_string) | **POST** /echo/body/Pet/response_string | Test empty response body
# **test_binary_gif**
> bytearray test_binary_gif()
Test binary (gif) response body
Test binary (gif) response body
### Example
```python
from __future__ import print_function
import time
import os
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:3000
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
host = "http://localhost:3000"
)
# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = openapi_client.BodyApi(api_client)
try:
# Test binary (gif) response body
api_response = api_instance.test_binary_gif()
print("The response of BodyApi->test_binary_gif:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling BodyApi->test_binary_gif: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**bytearray**](bytearray.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: image/gif
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful operation | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **test_echo_body_pet**
> Pet test_echo_body_pet(pet=pet)