OCLOperators RestPost

RestPost and RestGet and RestDownload are all operators on the selfVM variable only available in ViewModels.

These operators enables you to get or put information into external REST based services.

See further description here Rest Services In MDriven

These operators work by giving a ViewModel Nesting that has data and additional Headers.

If the nesting has columns starting with :

  • FILENAME_xxx then the value if used as filename in a MultipartFormDataContent expecting a xxx column with byte data for the file content
  • HEADER_xxx then the value is added to the content as Headers.Add(xxx,value)
  • DEFAULTREQUESTHEADER_xxx then the value is added to the request as client.DefaultRequestHeaders.Add(xxx,value)
  • DEFAULTREQUESTHEADERMINUS_xxx then the value is added to the request as client.DefaultRequestHeaders.Add(xxx.Replace('_','-'),value) - this is so that headers with '-' can be entered
  • HEADERMINUS_xxx then the value is added to the content as Headers.Add(xxx.Replace('_','-'),value)

If the Nesting has a column named STRINGCONTENT then the request will be filled with  StringContent(value as string)

The default content is MultipartFormDataContent, (values as dictionary) for example used in the Oauth2 implementation for server to server authentication

This page was edited 2 days ago on 03/26/2024. What links here