簡體   English   中英

無法在基於 Node ExpressJS 服務器的服務器發送事件中檢索 req.body 的值?

[英]Cannot retrieve value of req.body in server-sent events based Node ExpressJS Server?

我正在嘗試將有效負載從 sse 客戶端發送到 sse 節點服務器。 我在 React 客戶端上接收 sse.js 以將有效負載發送回服務器,但收到 JSON 錯誤

SyntaxError: Unexpected token " in JSON at position 0 at JSON.parse () at createStrictSyntaxError (/home/salman/Desktop/my-sse-js/server/node_modules/body-parser/lib/types/json.js:158: 10)

React 客戶端節點 Express.js 服務器

json 文件似乎有一些錯誤,這就是 JSON.parse() 失敗的原因。 在 JSON 驗證器中檢查它,例如https://jsonlint.com/https://jsonformatter.curiousconcept.com/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM