AddString method

Official Content
This documentation is valid for:

Adds a string to the Http Request or Response.

It is used to create a custom request or response.

Syntax

&DataType.AddString(Value)

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

Example

This sample 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

Scope

Extended data types HttpClient data type, HttpResponse data type
Languages .NET, Java, Ruby, Visual FoxPro
   

See also

HttpClient data type
HttpResponse data type

Considerations

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.