How can I make an HTTP request and get both the response content and the response headers?
Or using the new Zinc framework , something like:
| response content headers | response := ZnClient new url: 'http://stackoverflow.com'; get; response. content := response contents. headers := response headers.
Probably the easiest way is if you download WebClientfrom http://www.squeaksource.com/WebClient .
WebClient
WebClient:
(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.
, - , pharo squeak
Source: https://habr.com/ru/post/1761029/More articles:пропускание положения вектора при нажатии push_back - c++Is delegation the preferred way to do this? - objective-cHow to use TFS 2010 to improve the development process? - tfsJavaScript namespace using Singleton? I'm at a dead end! - javascriptSearch SQL Server 2005 metadata to retrieve stored procedure parameters - sql-serverJavascript Json inside a loop - jsonWhat to use, C # or F #? In this case, the "real world" is c #I want to detect an item by double-clicking in the winforms listbox control. [how to handle a click on an empty area?] - c #A simple function to select the current jQuery function? - jqueryWhat happens if I do not call session_start ()? - phpAll Articles