问题
Im trying to access one specific call to the filemaker API, I have several requests which are working.. but if i try to do one with the fieldData field it doesn't work
var body = {"fieldData": {
"testId": myId
}};
HttpClient httpClient = new HttpClient();
HttpClientRequest request = await httpClient.postUrl(Uri.parse(url));
request.headers.set('content-type', 'application/json');
request.headers.add('authorization', 'bearer $token');
request.add(utf8.encode(json.encode(body)));
HttpClientResponse httpClientResponse = await request.close();
String reply = await httpClientResponse.transform(utf8.decoder).join();
httpClient.close();
I just get the error:
{"messages":[{"message":"Unknown parameter(s): fieldData","code":"960"}],"response":{}}
Edit: Url: https://{Server}/fmi/data/vLatest/databases/{database}/layouts/DataAPIaddresses/records/{id}
回答1:
Found it:
HttpClientRequest request = await httpClient.patchUrl(Uri.parse(url));
You have to patchUrl, because Filemaker wants a Patch request...
来源:https://stackoverflow.com/questions/63013709/flutter-request-filemaker-api-fielddata