Cisco Packet Tracer Extensions API 8.1.0
API for communication between Cisco Packet Tracer application and its extension applications and modules.
Public Member Functions | List of all members
HttpClient Class Reference

HttpClient handles and manipulates the HTTP client on devices. More...

Inheritance diagram for HttpClient:
Process HttpBackgroundClient

Public Member Functions

bool go (string)
 Creates an HTTP request to the specified URL. More...
 
bool http_get (string, string)
 
bool http_post (string, string, string)
 
bool http_delete (string, string, string)
 
bool http_put (string, string, string)
 
bool cancel ()
 cancel HTTP request and close tcp connection. More...
 
string getLastPageContent ()
 Returns the last page content retrived from an HTTP response. More...
 
void setHttps (bool)
 Sets the HttpClient process to use HTTPS if status is true, otherwise HTTP. More...
 
bool isHttps ()
 Returns true if the HttpClient process is set to HTTPS, false if HTTP. More...
 
void onStart (string)
 IPC event. More...
 
void onDone (string, ip, HttpResponseType, string)
 IPC event. More...
 
- Public Member Functions inherited from Process
Device getOwnerDevice ()
 Returns the device for this process. More...
 

Detailed Description

HttpClient handles and manipulates the HTTP client on devices.

Member Function Documentation

◆ cancel()

bool HttpClient::cancel ( )

cancel HTTP request and close tcp connection.

Returns
bool, true if successful, otherwise false.

◆ getLastPageContent()

string HttpClient::getLastPageContent ( )

Returns the last page content retrived from an HTTP response.

Returns
string, the last page content retrived from an HTTP response.

◆ go()

bool HttpClient::go ( string  )

Creates an HTTP request to the specified URL.

Parameters
url,theURL of the destination.
Returns
bool, true if successful, otherwise false.

◆ http_delete()

bool HttpClient::http_delete ( string  ,
string  ,
string   
)

◆ http_get()

bool HttpClient::http_get ( string  ,
string   
)

◆ http_post()

bool HttpClient::http_post ( string  ,
string  ,
string   
)

◆ http_put()

bool HttpClient::http_put ( string  ,
string  ,
string   
)

◆ isHttps()

bool HttpClient::isHttps ( )

Returns true if the HttpClient process is set to HTTPS, false if HTTP.

Returns
bool, true if the HttpClient process is set to HTTPS, false if HTTP.

◆ onDone()

void HttpClient::onDone ( string  ,
ip  ,
HttpResponseType  ,
string   
)

IPC event.

◆ onStart()

void HttpClient::onStart ( string  )

IPC event.

◆ setHttps()

void HttpClient::setHttps ( bool  )

Sets the HttpClient process to use HTTPS if status is true, otherwise HTTP.

Parameters
status,trueif HTTPS, false if HTTP.

The documentation for this class was generated from the following file: