My ServiceStack Backend

<back to all web services

LoginRequest

The following routes are available for this service:
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()),
});

Dart LoginRequest 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

HTTP + JSON

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: application/json
Content-Type: application/json
Content-Length: length

{"username":"String","password":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"language":"String","responseCode":0,"responseMessage":"String"}