POST 請求 GET請求

2022-03-09 03:14:58 字數 700 閱讀 4294

get:

引數:username 和 password

1.get的請求都拼接在url中

2.?後面是跟的引數 ?前面跟的都是介面

3.引數的形式key = value&key2=value2

對於get請求 所有得引數都拼接在url中,這樣暴露在外面 會造成資料的不安全

url的長度是有限制的 如果引數過於長的話,是不能拼接在url中的

get請求會預設在本地快取

- (void)touchesbegan:(nsset*)touches withevent:(uievent *)event

]resume];

}

post :

特點:1.post請求的引數都放在都放在請求體中 理論上沒有長度限制

2.外界檢視不到post請求引數的內容,post請求比get請求安全,涉及到私密資訊,一定要用post請求

3.post請求預設不會快取在本地

post  必須設定可變的請求 不可變的請求是不可以的

檔案上傳只能用post請求

- (void)touchesbegan:(nsset*)touches withevent:(uievent *)event

]resume];}//

獲取post的請求體

- (nsdata *)getrequestbody

Get請求 Post請求

複製直接用 post同步請求 void synchronourequestbypost post非同步請求 1.方法 void asynchronourequestbypost void connection nsurlconnection connection didreceiveresponse...

get請求 post請求

今天由於群裡的人說出了這個問題,在這裡總結一下,順便加強記憶。get和post是http請求的兩種基本方法,要說它們的區別 直觀的區別就是get把引數包含在url中,post通過request body傳遞引數 本標準答案參考自w3schools 這只是乙個表面的並不是深層的更深一步理解 get和p...

get請求 post請求

1.get請求 不攜帶引數的get請求 不攜帶引數的get請求 headers 攜帶引數的get請求 headers 2.post請求 構建引數的post請求 3.響應資料的獲取與屬性 1 響應資料的獲取 res.text 文字資料 res.json json資料 res.content 流 2 向...