[英]React native connect to local database with php and axios
我在通過 PHP 將前端連接到后端時遇到問題。 數據庫連接到 PHP 但不是前端,當我在 Postman 上運行它時,它會打印出 500 internal server error。
axios
.get(Api, {
params: {
route: "extension/account/purpletree_multivendor/api/sellers",
language_id: this.props.language,
search_text: this.state.searchTxt.toUpperCase(),
category_id: categoryId.toString(),
geocode: geocode,
},
headers: {
'Content-Type': 'application/json',
},
})
.then((res) => {
//handle no seach item
if (res.data.success) {
if (res.data.message !== "No Data") {
this.setState({
sellers: res.data.data.sellers,
isLoading: false,
});
} else {
this.setState({ isLoading: false, showMessage: true });
}
} else {
//show error message
this.setState({ isLoading: false });
}
});
感謝您回答這個問題,我問了我的一位導師並想通了:
display_errors
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.