Official Content

Adds a string to the Http Request or Response.

Syntax

&DataType.AddString(Value)

Where:
&DataType
     Variable name based on an HttpClient or an HttpResponse data type.

Value
   Any character data (including Character, Varchar and Longvarchar data type attributes | variables).

Scope

Extended data types: HttpClient, HttpResponse
Generators: .NET Framework.NETJava

Description

This method is used to create a custom request or response.

Samples

This is a Procedure object with the Main program property set as True and the Call protocol property set as HTTP with the following source:

&httpresponse.AddString(!"<html>")
&httpresponse.AddString(!"Hello world")
&httpresponse.AddString(!"</html>")
// &httpresponse is HttpResponse data type

It creates a sample html page, sending the html code in the Http response; the browser will render the html code:

AddStringSample_v18u5

Note: Do not use this method if you need to send a file content as a string because the string is encoded, for this case use the AddFile method.

See Also

HttpClient data type
HttpResponse data type

  

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant