Required role: | REGISUserRole |
POST | /directory/{uuid}/image/upload |
---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class DirectoryImageUploadRequest implements IConvertible
{
Uint8List? file;
String? file_base64;
String? uuid;
String? contentType;
DirectoryImageUploadRequest({this.file,this.file_base64,this.uuid,this.contentType});
DirectoryImageUploadRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
file = JsonConverters.fromJson(json['file'],'Uint8List',context!);
file_base64 = json['file_base64'];
uuid = json['uuid'];
contentType = json['contentType'];
return this;
}
Map<String, dynamic> toJson() => {
'file': JsonConverters.toJson(file,'Uint8List',context!),
'file_base64': file_base64,
'uuid': uuid,
'contentType': contentType
};
getTypeName() => "DirectoryImageUploadRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'data.regent_college.edu', types: <String, TypeInfo> {
'DirectoryImageUploadRequest': TypeInfo(TypeOf.Class, create:() => DirectoryImageUploadRequest()),
'Uint8List': TypeInfo(TypeOf.Class, create:() => Uint8List(0)),
});
Dart DirectoryImageUploadRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /directory/{uuid}/image/upload HTTP/1.1
Host: data.regent-college.edu
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
file: AA==,
file_base64: String,
uuid: String,
contentType: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } }