Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Internet Protocols Module User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

A.2 Migrating from RWIHttpAgent to RWHttpAgent

RWIHttpAgent is deprecated and has been replaced by RWHttpAgent. Migrating to RWHttpAgent requires moving variables and removing lines of code.

RWHttpAgent returns more information with the request than RWIHttpAgent:

For more information about RWHttpAgent, see Section 5.3, "Using the HTTP Classes," Section 5.4, "Advanced Topics," and the SourcePro C++ API Reference Guide.

The following examples show the differences between using RWIHttpAgent and RWHttpAgent. Example 34 requests the root document of the www.roguewave.com Web site using RWIHttpAgent.

Example 34: Using RWIHttpAgent

//1

Creates an RWIHttpAgent class connected to www.roguewave.com. All requests are sent as HTTP/1.0 compliant requests.

//2

Requests the root document from the server. It is returned as an IOU.

//3

Redeems the IOU for the RWSocketPortal, and stores it in an actual RWSocketPortal instance.

//4

Loops over the portal extracting the body of the message, and stores it in the RWCString body.

Example 35 shows how to do the same task using RWHttpAgent.

Example 35: Using RWHttpAgent

//1

Creates an RWHttpAgent. Connection information is not necessary because connections are created when needed.

//2

Requests the root document from www.roguewave.com using an RWURL object.

//3

Redeems the returned IOU for an RWHttpReply object.

//4

Gets the body of the message from the RWHttpReply.



Previous fileTop of DocumentContentsIndex pageNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.