POST | /login |
---|
import 'package:servicestack/servicestack.dart';
class LoginResponse implements IConvertible
{
String? language;
int? responseCode;
String? responseMessage;
LoginResponse({this.language,this.responseCode,this.responseMessage});
LoginResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
language = json['language'];
responseCode = json['responseCode'];
responseMessage = json['responseMessage'];
return this;
}
Map<String, dynamic> toJson() => {
'language': language,
'responseCode': responseCode,
'responseMessage': responseMessage
};
getTypeName() => "LoginResponse";
TypeContext? context = _ctx;
}
class LoginRequest implements IConvertible
{
String? username;
String? password;
LoginRequest({this.username,this.password});
LoginRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
username = json['username'];
password = json['password'];
return this;
}
Map<String, dynamic> toJson() => {
'username': username,
'password': password
};
getTypeName() => "LoginRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'portal_api.migrantleap.com', types: <String, TypeInfo> {
'LoginResponse': TypeInfo(TypeOf.Class, create:() => LoginResponse()),
'LoginRequest': TypeInfo(TypeOf.Class, create:() => LoginRequest()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /login HTTP/1.1
Host: portal-api.migrantleap.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"username":"String","password":"String"}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"language":"String","responseCode":0,"responseMessage":"String"}