2019-9
一、URL格式(Uniform Resource Locator,統一資源定位符)
1、參考網址:訪問帶有用戶名、密碼保護的 URL
格式:http://username:password@host:8080/directory/file?query#ref:
?
2、參考書籍:《圖解HTTP》第27頁
查詢字符串: 針對已指定的文件路徑內的資源,可以使用查詢字符串傳入任意參數。此項可選。(這樣可以在URL中直接下發參數和命令); 3、HTTP協議 瀏覽器輸入URL,敲回車后,一般下發的是“GET”方法, 如: 1)瀏覽器給restful_server:
GET / HTTP/1.1\r\nHost: 192.168.22.190:8000\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: zh-CN,zh;q=0.9\r\nProxy-Connection: keep-alive\r\nUpgrade-Insecure-Requests: 1\r\nX-Lantern-Version: 5.5.6\r\n\r\n ?
?2)restful_server給瀏覽器:
HTTP/1.1 200 OK\r\nServer: Mongoose/6.15\r\nDate: Tue, 24 Sep 2019 10:51:51 GMT\r\nLast-Modified: Tue, 24 Sep 2019 08:11:13 GMT\r\nAccept-Ranges: bytes\r\nContent-Type: text/html\r\nConnection: keep-alive\r\nContent-Length: 1991\r\nEtag: "5d89cfa1.1991"\r\n\r\n<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8" />\n<title>RESTful API demo</title>\n<meta name="viewport" content="width=device-width, initial-scale=1" />\n<style type="text/css">\n* { outline: none; }\nbody {\nbackground-color: #789; margin: 0;\npadding: 0; font: 16px/1.4 Helvetica, Arial, sans-serif;\nfont: 16px/1.4 Helvetica, Arial, sans-serif;\n}\ndiv.content {\nwidth: 800px; margin: 2em auto; padding: 20px 50px;\nbackground-color: #fff; border-radius: 1em;\n}\nlabel { display: inline-block; min-width: 7em; }\ninput { border: 1px solid #ccc; padding: 0.2em; }\na:link, a:visited { color: #69c; text-decoration: none; }\n@media (max-width: 700px) {\nbody { background-color: #fff; }\ndiv.content { width: auto; margin: 0 auto; padding: 1em; }\n}\n</style>\n\n<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>\n<script language="javascript" type="text/javascript">\njQuery(function() {\n\n$(document).on('keyup', '#n1, #n2', function() {\n$.ajax({\nurl: '/api/v1/sum',\nmethod: 'POST',\ndataType: 'json',\ndata: { n1: $('#n1').val(), n2: $('#n2').val() },\nsuccess: function(json) {\n$('#result').html(json.result);\n}\n});\n});\n\n});\n</script>\n</head>\n<body>\n<div class="content">\n<h1>RESTful API demo.</h1>\n\n<p>\nThis page demonstrates how Mongoose could be used to implement\nRESTful APIs. Start typing numbers into the text fields below.\nBrowser sends two numbers to <tt>/api/v1/sum</tt> URI.\nWeb server calclulates the sum and returns the result.\n</p>\n\n<div>\n<label>Number 1:</label> <input type="text" id="n1" />\n</div><div>\n<label>Number 2:</label> <input type="text" id="n2" />\n</div><div>\n\t<!--\n<label>Result:</label> <span id="result"> </span>\n\t-->\n</div><div>\n\t<label>Result:</label> <span id="result"></span>\n\n</div>\n</body>\n</html>\n
二、linux下SVN不會自動輸入密碼的解決辦法
1、參考文檔1:Linux下svn密碼問題
2、參考文檔2:Linux下SVN賬戶密碼保存設置
3、如果按照上面的辦法還無法解決問題,則使用終極大招,修改SVN的賬號和密碼文件,位置:~/.subversion/auth/svn.simple
?三、cjson
1、參考網址:1:cJSON的源碼下載(github)及使用說明
2、參考網址2:cJSON的使用方法
四、mongoose與resful server
1、參考網址1:Mongoose搭建RESTful http/https web server
2、參考網址2:使用mongoose實現restful server
五、linux shell中的select與function
1、參考網址1:shell編程——select語句
2、參考網址2:Shell腳本中select、函數總結
六、c語言
1、#、##、...、__VA_ARGS__的區別與使用
參考網址1:整理:C/C++可變參數,“## __VA_ARGS__”宏的介紹和使用
參考網址2:GNU C語言 宏定義 #args ##args
參考網址3:#、##、__VA_ARGS__和##__VA_ARGS__的作用
總結:
打印調試信息方法:
GCC: #define dbgprintf(format, args...) fprintf(stdout, format, ##args)C99: #define dbgprintf(fmt, ...) printf(fmt, __VA_ARGS__) 或 #define dbgprintf(...) printf(__VA_ARGS__)
?
?
七、網頁播放器
1、參考網址1:使用Chrome打開http://www.cutv.com/demo/live_test.swf頁面時swf文件自動下載問題
八、linux
1、參考網址1:/proc/uptime詳解,獲取系統啟動時間,系統負載率
2、參考網址2:Linux中/proc目錄下文件詳解
3、參考網址3:linux驅動編寫之poll機制
九、SVN操作
1、命令行svn commit時,注釋怎么實現換行效果
svn ci -m $'first line\nsecond line'? ?重點是單引號前的$
2、SVN更新后,前邊字母的提示含義
U:表示從服務器收到文件更新了 G:表示本地文件以及服務器文件都已更新,而且成功的合并了 A:表示有文件或者目錄添加到工作目錄 R:表示文件或者目錄被替換了. C:表示文件的本地修改和服務器修改發生沖突
轉載于:https://www.cnblogs.com/shanyu20/p/11498874.html
總結
- 上一篇: Phos 技术服务支持
- 下一篇: CF332C Students' Rev