get請求參數(shù)放body 接口編程中,為什么只用get和post?
接口編程中,為什么只用get和post?得到,帖子就夠了。。什么restful接口?完成這項工作很好。不要處理花哨的requestbodyhttpentity傳遞的數(shù)據(jù)。它通常用于處理非內容類型的數(shù)據(jù)
接口編程中,為什么只用get和post?
得到,帖子就夠了。。什么restful接口?完成這項工作很好。不要處理花哨的
requestbody
httpentity傳遞的數(shù)據(jù)。它通常用于處理非內容類型的數(shù)據(jù):application/x-www-form-urlencoded格式。
在get請求中,@requestbody不適用,因為沒有httpentity。
在post請求中,通過httpentity傳遞的參數(shù)必須在請求頭中聲明數(shù)據(jù)類型content type。Spring MVC使用由
handleradapter配置的httpmessage轉換器解析httpentity中的數(shù)據(jù),然后將其綁定到相應的bean。
Requestparam
用于處理內容類型:content encoded for application/x-www-form-urlencoded。(在HTTP協(xié)議中,如果未指定內容類型,則默認情況下傳遞的參數(shù)是application/x-www-form-urlencoded的類型。)