一些標準的后端框架都是區(qū)分大小寫的,小程序能否不要自動轉(zhuǎn)為小寫?比如:
{'Authorization': 'Bearer ' + api_token}就被轉(zhuǎn)成了{'authorization': 'Bearer xxxxx'}導(dǎo)致后端必須要通過其他途徑來達到目的。
網(wǎng)友回復(fù):
話說,按照 HTTP 標準協(xié)議,這個應(yīng)該是大小寫不敏感的,所以你的服務(wù)器端應(yīng)該考慮大小寫兼容才對。
https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive. |
是我的問題,我自己解決一下,謝謝。