Requires any of the roles: | Admin, TeamAdmin, MobileApp | Requires the permission: | ReadData |
GET POST | /hello/{Name} | ||
---|---|---|---|
GET POST | /hello |
import 'package:servicestack/servicestack.dart';
class HelloResponse implements IConvertible
{
String? result;
HelloResponse({this.result});
HelloResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
result = json['result'];
return this;
}
Map<String, dynamic> toJson() => {
'result': result
};
getTypeName() => "HelloResponse";
TypeContext? context = _ctx;
}
class Hello implements IConvertible
{
String? name;
bool? isWoman;
int? age;
Hello({this.name,this.isWoman,this.age});
Hello.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
name = json['name'];
isWoman = json['isWoman'];
age = json['age'];
return this;
}
Map<String, dynamic> toJson() => {
'name': name,
'isWoman': isWoman,
'age': age
};
getTypeName() => "Hello";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'stubbur_autoupdates_live.smartnewapis.com', types: <String, TypeInfo> {
'HelloResponse': TypeInfo(TypeOf.Class, create:() => HelloResponse()),
'Hello': TypeInfo(TypeOf.Class, create:() => Hello()),
});
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 /hello/{Name} HTTP/1.1
Host: stubbur-autoupdates-live.smartnewapis.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
name: String,
isWoman: False,
age: 0
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { result: String }