php async / await with fetch
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php async / await with fetch相关的知识,希望对你有一定的参考价值。
const Url = "gas_log/link_transactions";
(async () => {
const rawResponse = await fetch(Url, {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({store_number: storeNumber})
});
const content = await rawResponse.json();
})();
public function link_transactions() {
$postData = json_decode(file_get_contents('php://input'), true);
}
以上是关于php async / await with fetch的主要内容,如果未能解决你的问题,请参考以下文章
javascript Async Await Action Creator with Redux Thunk
Promise/async-await with mongoose,返回空数组
python3.6,async with和await的区别
浅谈Async/Await
Atitit. Async await 优缺点 异步编程的原理and实现 java c# php
细谈回调地狱终极解决方案及ES7新语法async和await