Editing
Troubleshooting of curl errors in Mandarin
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== 如何解決 cUrl error (3) bad range in URL position xx === '''問題''' 當使用 curl 下載包含特殊字符(如 `[]`)的 URL 時,你可能會遇到這個錯誤: <pre> curl: (3) bad range in URL position 33 </pre> '''解決方法''' 將特殊字符轉換為 URL 編碼格式: <pre> # 錯誤示範 curl "https://example.com/api?param[0]=value" # 正確示範 curl "https://example.com/api?param%5B0%5D=value" </pre> 常見的 URL 編碼對照: * `[` 轉換為 `%5B` * `]` 轉換為 `%5D` * 空格轉換為 `%20` '''說明''' * URL 規範要求某些特殊字符必須經過編碼才能使用 * 像 `[]` 這樣的字符在 URL 中有特殊含義,直接使用可能會導致解析錯誤 * URL 編碼確保這些特殊字符能被正確傳輸和解析 如果你不確定是否需要編碼,可以使用線上 URL 編碼工具進行轉換,例如:[https://www.urlencoder.org/ URL 線上編碼和解碼工具]。
Summary:
Please note that all contributions to LemonWiki共筆 are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
LemonWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Current events
Recent changes
Random page
Help
Categories
Tools
What links here
Related changes
Special pages
Page information