# j-FormData

> With this component you can send data via the POST/PUT/DELETE method to the current window or another.

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: en
Content-SHA256: aa184025d0249bd48512426da243185b52d0ab034cdbd3850581203a46cc45fa
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

With this component you can send data via the POST/PUT/DELETE method to the current window or another.

- singleton

### Configuration

- `method {String}` a default HTTP method (default: `POST`)
- `target {String}` a default target (default: `_blank`)
- `type {String}` a default form type (default: `application/x-www-form-urlencoded`)

### Methods

- `component.send(opt)`
	- `opt.method {String}` form method, default `config.method`
	- `opt.target {String}` form target, default `config.target`
	- `opt.type {String}` form type, default `config.target`
	- `opt.url {String}` __required__ URL address
	- `opt.data {Object}` __required__ form data in the form `{ key1:value, key2:value }`

Use it with `<ui-component name="formdata">`. When the component is not loaded yet, jComponent downloads it on first use from the address in `DEF.fallback` (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

```html example.html
<ui-component name="LAZY formdata"></ui-component>
<button>Send data</button>

<script>

	$(document).on('click', 'button', function() {
		SETTER('formdata/send', { url: 'http://127.0.0.1:8000/api/', data: { name: 'Total.js Platform' }});
	});

</script>
```
