這個(gè)視頻讓我知道了http和socket之間的關(guān)系,同樣的原理感覺(jué)也可以實(shí)現(xiàn)ftp等其他應(yīng)用層協(xié)議。真心牛逼。
2016-11-23
Content-Length返回的字符前面還有一個(gè)空格,,,真是醉了...replace(" ", "");
2016-10-27
coding時(shí)的聲音是Stay的聲音,和之前介紹基礎(chǔ)知識(shí)時(shí)的聲音不一樣
另單獨(dú)下載的Postman軟件post發(fā)送圖片頭文件沒(méi)有Content-Length關(guān)鍵字,后下載for Chrome Postman 插件解決。
2016-10-18
找到不能解析Content-Length的問(wèn)題在SimpleHttpServer函數(shù)這句httpContext.addRequestHeader(pair[0],pair[1]);往HashMap表里存儲(chǔ)字符串value值時(shí)含有\(zhòng)r\n這兩個(gè)字符串導(dǎo)致在UploadImageHandler函數(shù)中l(wèi)ong totalLength = Long.parseLong("Content-Length");不能正確執(zhí)行,解決:在SimpleHttpServer函數(shù)上邊那句改為httpContext.addRequestHeader(pair[0],pair[1].replace("\r\n",""));
2016-10-18
老師按照您的方式 用 Postman 發(fā)送圖片文件,頭中沒(méi)有Content-Length那一項(xiàng),以至于
long totallength = Long.parseLong(httpContext.getRequestHeaderValue("Content-Length"));
取不到數(shù)據(jù)
long totallength = Long.parseLong(httpContext.getRequestHeaderValue("Content-Length"));
取不到數(shù)據(jù)
2016-10-16