This is an automated email from the ASF dual-hosted git repository.

lidongdai pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 19c2b27  Front-end development documents supplement Content-Type 
request interface parameter transfer method (#279)
19c2b27 is described below

commit 19c2b275f529ef1557f436fcde23fbc7eaa2ab34
Author: break60 <[email protected]>
AuthorDate: Thu Jan 21 19:27:00 2021 +0800

    Front-end development documents supplement Content-Type request interface 
parameter transfer method (#279)
---
 development/en-us/frontend-development.md | 9 +++++++++
 development/zh-cn/frontend-development.md | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/development/en-us/frontend-development.md 
b/development/en-us/frontend-development.md
index 1123b4b..538021f 100644
--- a/development/en-us/frontend-development.md
+++ b/development/en-us/frontend-development.md
@@ -510,6 +510,15 @@ Error return
   msg:'failed'
 }
 ```
+If the interface is a post request, the Content-Type defaults to 
application/x-www-form-urlencoded; if the Content-Type is changed to 
application/json,
+Interface parameter transfer needs to be changed to the following way
+```
+io.post('url', payload, null, null, { emulateJSON: false } res => {
+  resolve(res)
+}).catch(e => {
+  reject(e)
+})
+```
 
 ##### Related interface path
 
diff --git a/development/zh-cn/frontend-development.md 
b/development/zh-cn/frontend-development.md
index 27861c5..529da37 100644
--- a/development/zh-cn/frontend-development.md
+++ b/development/zh-cn/frontend-development.md
@@ -507,6 +507,15 @@ test.then(res => {
   msg:'失败'
 }
 ```
+接口如果是post请求,Content-Type默认为application/x-www-form-urlencoded;如果Content-Type改成application/json,
+接口传参需要改成下面的方式
+```
+io.post('url', payload, null, null, { emulateJSON: false } res => {
+  resolve(res)
+}).catch(e => {
+  reject(e)
+})
+```
 
 ##### 相关接口路径
 

Reply via email to