Fanhuaji / discussion

記錄有關繁化姬的議題或是內容
37 stars 0 forks source link

API 回應的翻譯結果會用空格取代「+」 #43

Closed Louie997 closed 4 months ago

Louie997 commented 4 months ago

API 回應的翻譯結果會用空格取代「+」。

例如請求「写入 server_isn+1 值」,會回應以下內容:

{"code":0,"data":{"converter":"Taiwan","text":"寫入 server_isn 1 值","diff":null,"textFormat":"PlainText","usedModules":["QuotationMark"],"jpTextStyles":[]},"msg":"Unknown module: `*`.","revisions":{"build":"dict-e89a2c6e-r1048","msg":"fix: 例行性修正字詞 20240526","time":1717179185},"execTime":0.011}
jfcherng commented 4 months ago

無法重現問題, 網頁與 postman 皆無法重現

Louie997 commented 4 months ago

我發現需要先對請求的文本做 url 編碼才能得到正確的回應,就是把 +%2B 取代

所以是我少做了 url 編碼嗎?可是為什麼其他需要另外編碼的字元(例如%)不用另外轉換也不會出錯?網路初學者好奇的問一下

jfcherng commented 4 months ago

我比較好奇這些事情在現在的網路程式庫應該都自動幫你做掉了...

jfcherng commented 4 months ago

聽起來你用的像是 GET method, 是的話你用錯了請用 POST GET 只是單純為了 click 即 demo 而弄出來的東西

Louie997 commented 4 months ago

了解,感謝解惑,也感謝提供繁化姬的 api ~