forked from loafle/openapi-generator-original
* Instead of limiting a request to a single file when performing an upload, use a slice of files so an arbitrary number of files can be used in the form. * Remove commented out line of code * Update examples for multi-form file fix for multiple files * Convert spaces to tabs for indentation * Updated examples to have tabs instead of spaces * Add an example of a multipart/form-data OA3 schema that contains two files to be uploaded
1.9 KiB
1.9 KiB
\DefaultApi
All URIs are relative to http://example.com
Method | HTTP request | Description |
---|---|---|
UploadFiles | Post /uploadFiles | uploads two files |
UploadFiles
ApiResponse UploadFiles(ctx).File(file).SecondFile(secondFile).Execute()
uploads two files
Example
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
file := os.NewFile(1234, "some_file") // *os.File | file to upload (optional)
secondFile := os.NewFile(1234, "some_file") // *os.File | another file to upload (optional)
configuration := openapiclient.NewConfiguration()
api_client := openapiclient.NewAPIClient(configuration)
resp, r, err := api_client.DefaultApi.UploadFiles(context.Background()).File(file).SecondFile(secondFile).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UploadFiles``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UploadFiles`: ApiResponse
fmt.Fprintf(os.Stdout, "Response from `DefaultApi.UploadFiles`: %v\n", resp)
}
Path Parameters
Other Parameters
Other parameters are passed through a pointer to a apiUploadFilesRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
file | *os.File | file to upload | |
secondFile | *os.File | another file to upload |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]