Flutter request Filemaker API (FieldData)

蹲街弑〆低调 提交于 2020-08-10 19:34:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!