Xojo.Net.HTTPSocket.PageReceived

From Xojo Documentation

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)