PUT - AppDaddy-Software-Solutions-Inc/framework-markup-language GitHub Wiki

<PUT/> : Http

The PUT datasource widget is used to create or update data via an API endpoint using the standard HTTP PUT method. Like all HTTP methods, PUT can also return bindable response data upon succeeding. Response can be returned as JSON or XML(default).

Table of Contents

Usage

The PUT widget is used to make an idempotent put call and put and automatically built a data document within a FORM using FormField widget id's and the <FormID>.complete() event, or put a manually built data document inside of the framework using <id>.start() on the datasource using bindings and xml tags. All HTTP datasources can have multiple TRANSFORM widgets to selectively transform data that is returned from the call.

Ideals:

  • To create or update data via an api.
  • To receive response data after a create or update task.
  • To make an http put method call that is idempotent.

Restrictions:

  • FormField IDs will be the surrounding their value when complete() or save() is called on the form.
  • If the method should not be idempotent, consider the POST widget.

Attributes :: HttpDataSource (inherited attributes)

Name Type Default Description Req
body string null The outer wrapper of the posting document tags. Used as an XML tag when defining a document manually, or attribute when creating the body automatically via a FORM

Methods :: HttpDataSource (inherited attributes)

Name Type Default Description Req

Examples

Example #1
<PUT id="P1" url="api/users/update">
    <BODY>
       <USER key="{KEY}">
         <PHONE>{PHONE}</PHONE>
       <USER>
    </BODY>
</PUT>

<INPUT id="KEY" text="Enter User Key"/>
<INPUT id="PHONE" text="Enter User Phone"/>
<BUTTON text="Submit" onclick="P1.start()"/>
Example #2
<PUT id="P2" url="api/users/update">
    <HEADERS>
      <HEADER key="content-type" value="application/json"/>
    </HEADERS>
    <BODY>
    <![CDATA[
       {"USER" : "key": "{KEY}", "phone" : "{PHONE}"}
    ]]>
    </BODY>
</PUT>

<INPUT id="KEY" text="Enter User Key"/>
<INPUT id="PHONE" text="Enter User Phone"/>
<BUTTON text="Submit" onclick="P2.start()"/>

logo See it in Action

Other Widgets You May Find Useful:

⚠️ **GitHub.com Fallback** ⚠️