POST | /RestApi/cache//add |
---|
import 'package:servicestack/servicestack.dart';
class AddExternalCacheRequest implements IConvertible
{
String? Url;
String? CacheKey;
List<String>? Keys;
AddExternalCacheRequest({this.Url,this.CacheKey,this.Keys});
AddExternalCacheRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Url = json['Url'];
CacheKey = json['CacheKey'];
Keys = JsonConverters.fromJson(json['Keys'],'List<String>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Url': Url,
'CacheKey': CacheKey,
'Keys': JsonConverters.toJson(Keys,'List<String>',context!)
};
getTypeName() => "AddExternalCacheRequest";
TypeContext? context = _ctx;
}
class AddExternalCacheResponse implements IConvertible
{
bool? Result;
String? Message;
AddExternalCacheResponse({this.Result,this.Message});
AddExternalCacheResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Result = json['Result'];
Message = json['Message'];
return this;
}
Map<String, dynamic> toJson() => {
'Result': Result,
'Message': Message
};
getTypeName() => "AddExternalCacheResponse";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'www.asg.com.au', types: <String, TypeInfo> {
'AddExternalCacheRequest': TypeInfo(TypeOf.Class, create:() => AddExternalCacheRequest()),
'AddExternalCacheResponse': TypeInfo(TypeOf.Class, create:() => AddExternalCacheResponse()),
});
Dart AddExternalCacheRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /RestApi/cache//add HTTP/1.1
Host: www.asg.com.au
Accept: application/json
Content-Type: application/json
Content-Length: length
{"Url":"String","CacheKey":"String","Keys":["String"]}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"Result":false,"Message":"String"}