Skip to content

用fetch在控制台测试接口 #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
chbro opened this issue Apr 13, 2018 · 3 comments
Open

用fetch在控制台测试接口 #28

chbro opened this issue Apr 13, 2018 · 3 comments

Comments

@chbro
Copy link

chbro commented Apr 13, 2018

模拟post方法进行测试,不一定总是要用postMan呢

fetch(apiUrl, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({q: 1})
}).then(async res => console.log(await res.json()))
@justjavac
Copy link
Owner

这个知识不冷吧,感觉也不实用,操作起来太麻烦,可以加到 snippets 里面。

@vanishcode
Copy link

路过,补充一点

@whyour
Copy link

whyour commented Feb 14, 2019

补充下。
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants