{% extends 'base.html' %} {% block title %}创建任务 - {{ get_app_name() }}{% endblock %} {% block content %}
<!-- HTML表单示例 -->
<form action="您的提交URL" method="post">
<!-- 表单字段 -->
<input type="text" name="name" placeholder="姓名">
<input type="email" name="email" placeholder="邮箱">
<button type="submit">提交</button>
</form>
// 使用fetch API提交数据
fetch('您的提交URL', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '用户名',
email: 'user@example.com',
// 其他字段
})
})
.then(response => response.json())
.then(data => console.log('提交成功:', data))
.catch(error => console.error('提交失败:', error));
import requests
import json
url = '您的提交URL'
data = {
'name': '用户名',
'email': 'user@example.com',
# 其他字段
}
response = requests.post(url, json=data)
print('提交成功:', response.json())