iT邦幫忙

2017 iT 邦幫忙鐵人賽
DAY 23
0
自我挑戰組

我的月薪嬌妻:HTTP系列 第 23

Day23-%20 ? + ?-URLEncode-2

  • 分享至 

  • xImage
  •  

但有時候會看到用+代表空白字元耶!世界要爆炸了嗎?

根據stackoverflow上的這篇

原來有另一份文件HTML 4.01 Specification application/x-www-form-urlencoded,其中提到當Content Type為application/x-www-form-urlencoded時,空白字元要被改為+

以查詢CNS11643中文全字庫,在查詢內碼輸入E6 91 98,結果如下

POST /AIDB/codetable_search.do HTTP/1.1
Host: www.cns11643.gov.tw
Connection: keep-alive
Content-Length: 41
Cache-Control: max-age=0
Origin: http://www.cns11643.gov.tw
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: http://www.cns11643.gov.tw/AIDB/codetable_search.do
Accept-Encoding: gzip, deflate
Accept-Language: zh-TW,zh;q=0.8,en-US;q=0.6,en;q=0.4,pt;q=0.2
Cookie: JSESSIONID=01A3E0A8A33D9D7E74B0679D6A55409F; treemenu1=0; __utma=66683132.1477942892.1482420409.1482420409.1482420409.1; __utmb=66683132.6.10.1482420409; __utmc=66683132; __utmz=66683132.1482420409.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)

Form data

fmt:utf-8%40unicode5_2
searchKey:E6+91+98

但是有另外發現yelp的搜尋功能似乎不是遵循RFC3986的建議。

:authority:www.yelp.com
:method:GET
:path:/search?find_desc=Restaurants&find_loc=%E6%9D%B1%E5%8D%80%2C+%E6%96%B0%E7%AB%B9%E5%B8%82&ns=1
:scheme:https
accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
accept-encoding:gzip, deflate, sdch, br
accept-language:zh-TW,zh;q=0.8,en-US;q=0.6,en;q=0.4,pt;q=0.2
referer:https://www.yelp.com/%E6%9D%B1%E5%8D%80-%E6%96%B0%E7%AB%B9%E5%B8%82-tw
upgrade-insecure-requests:1
user-agent:Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36

上一篇
Day22-20% ? %20 ?-URLEncode-1
下一篇
Day24-回覆的年齡-Age
系列文
我的月薪嬌妻:HTTP30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言