Xojo.Net.HTTPSocket.PageReceived

From Xojo Documentation

Revision as of 18:18, 11 August 2019 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Event


Xojo.Net.HTTPSocket.PageReceived(URL As Text, HTTPStatus As Integer, content As MemoryBlock)

Supported for all project types and targets.

Called when a new page has been retrieved from the server as a result of calling Send.

Parameters

Parameter Description
URL The URL that sent the response.
HTTPStatus The HTTP status code.
content A MemoryBlock containing the response. This may contain binary or text data.

Sample Code

Convert incoming JSON content from a MemoryBlock into a Dictionary:

Var jsonData As Text
// Convert the content returned from an API from a MemoryBlock to Text.
jsonData = Xojo.Core.TextEncoding.UTF8.ConvertDataToText(content)

// Parse the JSON result into a Dictionary
Var jsonDict As Xojo.Core.Dictionary
jsonDict = Xojo.Data.ParseJSON(jsonData)