I am using the OAuth hooks provided with a fresh creation of an Aqueduct project. My data is URI encoded in the following way:
var form = body.keys
.map((key) => "$key=${Uri.encodeQueryComponent(body[key])}")
.join("&");
I received the following error when attempting to register a User:
DataModelException: Type mismatch for property username on _User, expected assignable type matching ManagedPropertyType.string but got _ImmutableList. #0 ManagedValueBacking.setValueForProperty
The request looks like this:
HttpRequest.request('/register', method: 'POST',
sendData: form,
requestHeaders: {
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Basic $clientCredentials"
}).then((HttpRequest req) {
...
}).catchError((e) => _handleError(...));
I am just not too sure why the body is being interpreted as an ImmutableList.
I must be missing something!