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).
- Overview
- Usage
- Attributes :: HttpDataSource (inherited attributes)
- Methods :: HttpDataSource (inherited attributes)
- Examples - Example #1 - Example #2
- Other Widgets You May Find Useful:
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.
- 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.
- FormField IDs will be the surrounding their value when
complete()orsave()is called on the form. - If the method should not be idempotent, consider the
POSTwidget.
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 |
|---|
<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()"/><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()"/>