Form endpoint
Accepts the entries of a form. Only reachable from the page itself, at its own address.
Request#
POST/__sharepa/formular
Body as application/x-www-form-urlencoded, multipart/form-data or application/json (flat object).
Fields#
- anyText, number, list of textYour fields. At most 50, names up to 100 characters, values up to 10,000 characters.
- _honigTextBot trap, must stay empty.
- _formularTextName of the form, up to 60 characters.
- _weiterPathWhere to go after sending, on the same page.
Headers#
- acceptapplication/jsonAnswer as JSON instead of redirecting to the thank-you page.
JavaScript
const r = await fetch("/__sharepa/formular", {
method: "POST",
headers: {
"content-type": "application/json",
accept: "application/json",
},
body: JSON.stringify({
_formular: "Waitlist",
email: "anna@example.com",
}),
});Response#
Without accept: application/json, sharepa redirects with status 303, to _weiter or the thank-you page. With JSON:
- okBoolean
truewhen the entry is stored. - fehlerTextOnly with
ok: false. One of the error codes below.
Response 200
{ "ok": true }Response 422
{ "ok": false, "fehler": "formular.heikel" }Error codes#
| Code | Status | Meaning |
|---|---|---|
formular.herkunft | 403 | The request did not come from the page itself. |
formular.gesperrt | 401 | The page has a password, and the visitor has not unlocked it. |
formular.zuGross | 413 | The entry is larger than 100 KB. |
formular.ungueltig | 422 | The body could not be read, it has no fields, more than 50 fields, a name over 100 or a value over 10,000 characters. |
formular.heikel | 422 | A field looks like password, payment or health data. |
formular.langsam | 429 | Too many entries in a short time from the same visitor. |
formular.grenze | 429 | The limit of the page or the account is reached. |
Last updated