第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

React Native 和 FastAPI 問題

React Native 和 FastAPI 問題

斯蒂芬大帝 2023-08-22 18:36:21
我在創(chuàng)建 React Native 應(yīng)用程序時(shí)遇到了問題。我使用 FastAPI 作為后端。在向我的后端進(jìn)行此調(diào)用時(shí),沒有任何反應(yīng)。  function sendAkt() {    fetch("https://192.168.1.5:8000/newActivity", {      method: "POST",      headers: {        'Accept': "application/json",        "Content-Type": "application/json",      },      body: JSON.stringify({        name: ime,        desc: opis,        place: mjesto,        team: tim,        typeOf: pickerSel,        id: users.id,      }),    })    .then(_=> console.log('rea for the minute'))    .catch(e => console.log(e))  }沒有錯(cuò)誤,后端控制臺(tái)不會(huì)報(bào)告對(duì)后端路由進(jìn)行過調(diào)用??磥硖崛≈皇菕炱?。大約 3 分鐘后,控制臺(tái)中會(huì)彈出此信息Network request failed- node_modules\whatwg-fetch\dist\fetch.umd.js:505:17 in setTimeout$argument_0- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:135:14 in _callTimer- node_modules\react-native\Libraries\Core\Timers\JSTimers.js:387:16 in callTimers- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:425:19 in __callFunction- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:112:6 in __guard$argument_0- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:373:10 in __guard- node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:111:4 in callFunctionReturnFlushedQueue* [native code]:null in callFunctionReturnFlushedQueue這是我調(diào)用的后端路由@app.post('/newActivity')async def unos(request: NewActivity):    print('route Reaches')    # name = request.name    # desc = request.desc    # place = request.place    # team = request.team    # typeOf = request.typeOf    # id = request.id    # year = 10    # new_activity = Activities(activity_type_id=typeOf, academic_year_id=year,    #                           description=desc,    #                           user_id=id, team_id=team, title=name, location=place)    # session.add(new_activity)    # session.commit()    return JSONResponse(content='Uspijeh')這是我后端的 CORS 設(shè)置
查看完整描述

1 回答

?
阿晨1998

TA貢獻(xiàn)2037條經(jīng)驗(yàn) 獲得超6個(gè)贊

真是愚蠢的問題。我正在調(diào)用本地服務(wù)器而https不是http. Changing to http` 修復(fù)了它



查看完整回答
反對(duì) 回復(fù) 2023-08-22
  • 1 回答
  • 0 關(guān)注
  • 228 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)