Answer the question
In order to leave comments, you need to log in
How to initiate an http request (flask, requests, json) on button click?
1) There is a JSON format request in body.
POST api/entrepreneur/create
{
"last_name": "Galyamov",
"first_name": "Ramil",
"middle_name": "Sergeevich",
"birthed": "1997-10-12",
"snils": "161- 456-257 59",
"inn": "772792475156"
}
2) In Flask, I made a button on the page
Question: how to make it so that when I click on the button, I sent an http request to the server with data in jSON format?
Those. make an analogue of the Send button in Postman
Answer the question
In order to leave comments, you need to log in
Take an HTML form, fill in the data. Write a form handler in JS, in which, when you click on Submit, form it into an object that sends an AJAX request in a serialized form using JSON.stringify()
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question