如何發出HTTP請求並獲取響應內容和響應頭?在Pharo中發出HTTP請求並獲取響應頭
3
A
回答
3
也許最簡單的是,如果你從http://www.squeaksource.com/WebClient加載WebClient
。
0
1
要安裝Web客戶端做更多的東西與他們,海邊一鍵圖片:
(Installer ss project: 'WebClient')
install: 'WebClient-Core'
然後
response := WebClient httpGet: 'http://www.google.com/'.
headers := response headers. "An OrderedCollection of headername -> headervalue"
body := response content.
5
或者使用新的Zinc framework,如:
| response content headers |
response := ZnClient new
url: 'http://stackoverflow.com';
get;
response.
content := response contents.
headers := response headers.
相關問題
- 1. 如何發送HTTP請求並獲取HTTP響應
- 2. 發佈請求並獲取響應robotframework
- 3. php http請求獲取.text響應
- 4. PHP HTTP請求獲取JSON響應
- 5. 從HTTP請求獲取自定義響應標頭
- 6. 如何使用Netty獲取http請求/響應頭的大小?
- 7. jmeter捕獲所有請求和響應頭單個http請求觸發
- 8. 在發送http請求後獲取響應數據(python requests)
- 9. 如何在iPhone中發送請求並獲取文件響應?
- 10. 如何獲取發送API請求並獲取Json響應c#
- 11. HTTP頭400錯誤的請求響應
- 12. 帶出HTTP請求的HTTP響應
- 13. 向服務器發送HTTP POST請求並獲得響應?
- 14. 從http獲取請求的響應請求
- 15. 如何製作HTTP Post請求並獲取響應爲JSON Android
- 16. NodeJS API使嵌套http獲取請求並返回響應
- 17. 如何通過spring RestTemplate在獲取請求中更改響應http頭?
- 18. 如何從ajax發佈請求獲取響應頭
- 19. 從http請求獲取json響應時出錯
- 20. 響應重定向vs http請求獲取響應
- 21. 在java中獲取確切的http web響應httpurlconnection請求
- 22. 在php中響應http獲取請求與json對象
- 23. 在Angular中從HttpClient post請求獲取響應頭文件?
- 24. 如何在C#中響應後獲取請求頭的Cookie#
- 25. 鏈HTTP請求和合並JSON響應
- 26. Android只獲取http請求的標頭
- 27. 從http請求獲取授權標頭
- 28. Http請求/併發?
- 29. iOS:發送http請求/讀取http響應
- 30. HTTP/1.1 401未經授權的響應頭在獲取負載亞軍請求
WebClient也有實際有用的文檔! – 2010-08-23 07:45:13