这是一个简单的HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <form method="POST" action="https://sm.ms/api/upload" enctype="multipart/form-data"> <input name="smfile" type="file"> <input type="submit" name="upload"> </form> </body> </html>
我POST过去后.,服务器(第三方)回传一个JSON给我.
{
code: "success",
data: {
width: 440,
height: 440,
filename: "timg.jpg",
storename: "5a7b1807506b2.jpg",
size: 11941,
path: "/2018/02/07/5a7b1807506b2.jpg",
hash: "m8FqIYBGWL1HDrT",
timestamp: 1518016519,
ip: "111.29.138.47",
url: "https://i.loli.net/2018/02/07/5a7b1807506b2.jpg",
delete: "https://sm.ms/delete/m8FqIYBGWL1HDrT"
}
}
那么我要如何把这个JSON在传给我的后台呢?
用AJAX,在POST成功后在加嵌套一个POST?
产品经理不是经理
XO鸡丝
相关分类