OCLOperators RestPost
No edit summary
No edit summary
Line 8: Line 8:


If the nesting has columns starting with :
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
* '''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)
* '''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)
* '''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
* '''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)
* '''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

Revision as of 08:54, 29 September 2017

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

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