OCLOperators RestPost
No edit summary
No edit summary
Line 15: Line 15:
If the Nesting has a column named '''STRINGCONTENT''' then the request will be filled with  StringContent(value as string)
If the Nesting has a column named '''STRINGCONTENT''' then the request will be filled with  StringContent(value as string)


The default content is MultipartFormDataContent
The default content is MultipartFormDataContent, (values as dictionary) for example used in the [[Oauth2|Oauth2 implementation for server to server authentication]]
[[Category:OCLOperators]]
[[Category:OCLOperators]]

Revision as of 15:08, 10 March 2019

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 24 days ago on 03/26/2024. What links here