- FormData for the JavaScript target: https://developer.mozilla.org/en-US/docs/Web/API/FormData
Example: cmd: -r:off
import std/jsformdata let data: FormData = newFormData() data["key0"] = "value0".cstring data.add("key1".cstring, "value1".cstring) data.delete("key1") assert data.hasKey("key0") assert data["key0"] == "value0".cstring data.clear() assert data.len == 0
Procs
func `[]=`(self: FormData; name: cstring; value: SomeNumber | bool | cstring | Blob) {.importjs: "#.set(#, #)", ...raises: [], tags: [], forbids: [].}
- https://developer.mozilla.org/en-US/docs/Web/API/FormData/set Source Edit
func add(self: FormData; name: cstring; value: SomeNumber | bool | cstring | Blob) {. importjs: "#.append(#, #)", ...raises: [], tags: [], forbids: [].}
-
https://developer.mozilla.org/en-US/docs/Web/API/FormData/appendHint: Duplicate keys are allowed and order is preserved.Source Edit
func add(self: FormData; name: cstring; value: SomeNumber | bool | cstring | Blob; filename: cstring) {. importjs: "#.append(#, #, #)", ...raises: [], tags: [], forbids: [].}
-
https://developer.mozilla.org/en-US/docs/Web/API/FormData/appendHint: Duplicate keys are allowed and order is preserved.Source Edit
func newFormData(): FormData {.importjs: "new FormData()", ...raises: [], tags: [], forbids: [].}
- Source Edit