GET | /MyInfo |
---|
import 'package:servicestack/servicestack.dart';
class MyInfo implements IConvertible
{
MyInfo();
MyInfo.fromJson(Map<String, dynamic> json) : super();
fromMap(Map<String, dynamic> json) {
return this;
}
Map<String, dynamic> toJson() => {};
getTypeName() => "MyInfo";
TypeContext? context = _ctx;
}
class UserInfo implements IConvertible
{
int? id;
String? userAuthId;
String? nickName;
String? firstName;
String? lastName;
String? email;
String? company;
String? phoneNumber;
String? addressLine1;
String? addressLine2;
String? addressCity;
String? addressZip;
String? addressState;
String? addressCountry;
UserInfo({this.id,this.userAuthId,this.nickName,this.firstName,this.lastName,this.email,this.company,this.phoneNumber,this.addressLine1,this.addressLine2,this.addressCity,this.addressZip,this.addressState,this.addressCountry});
UserInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
id = json['id'];
userAuthId = json['userAuthId'];
nickName = json['nickName'];
firstName = json['firstName'];
lastName = json['lastName'];
email = json['email'];
company = json['company'];
phoneNumber = json['phoneNumber'];
addressLine1 = json['addressLine1'];
addressLine2 = json['addressLine2'];
addressCity = json['addressCity'];
addressZip = json['addressZip'];
addressState = json['addressState'];
addressCountry = json['addressCountry'];
return this;
}
Map<String, dynamic> toJson() => {
'id': id,
'userAuthId': userAuthId,
'nickName': nickName,
'firstName': firstName,
'lastName': lastName,
'email': email,
'company': company,
'phoneNumber': phoneNumber,
'addressLine1': addressLine1,
'addressLine2': addressLine2,
'addressCity': addressCity,
'addressZip': addressZip,
'addressState': addressState,
'addressCountry': addressCountry
};
getTypeName() => "UserInfo";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'account.servicestack.net', types: <String, TypeInfo> {
'MyInfo': TypeInfo(TypeOf.Class, create:() => MyInfo()),
'UserInfo': TypeInfo(TypeOf.Class, create:() => UserInfo()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /MyInfo HTTP/1.1 Host: account.servicestack.net Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <UserInfo xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/MyApp.ServiceModel"> <AddressCity>String</AddressCity> <AddressCountry>String</AddressCountry> <AddressLine1>String</AddressLine1> <AddressLine2>String</AddressLine2> <AddressState>String</AddressState> <AddressZip>String</AddressZip> <Company>String</Company> <Email>String</Email> <FirstName>String</FirstName> <Id>0</Id> <LastName>String</LastName> <NickName>String</NickName> <PhoneNumber>String</PhoneNumber> <UserAuthId>String</UserAuthId> </UserInfo>