All URIs are relative to http://localhost:8081
Method | HTTP request | Description |
---|---|---|
Upload | Post /upload | Upload file |
UploadResponse Upload(ctx).File(file).Execute()
Upload file
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/onpremless/go-client"
)
func main() {
file := os.NewFile(1234, "some_file") // *os.File |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.UploadAPI.Upload(context.Background()).File(file).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UploadAPI.Upload``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `Upload`: UploadResponse
fmt.Fprintf(os.Stdout, "Response from `UploadAPI.Upload`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiUploadRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
file | *os.File |
No authorization required
- Content-Type: multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]