Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Public Attributes
Paul::HTMLRequest Class Reference

#include <configurator.h>

Collaboration diagram for Paul::HTMLRequest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 HTMLRequest (Arc::Message &in)
 HTMLRequest ()
 ~HTMLRequest ()

Public Attributes

std::map< std::string,
std::string > 
POST
std::string path
std::string base_path
std::string method

Detailed Description

Definition at line 24 of file configurator.h.


Constructor & Destructor Documentation

Definition at line 75 of file configurator.cpp.

{
    method = in.Attributes()->get("HTTP:METHOD");
    path = in.Attributes()->get("PLEXER:EXTENSION");
    
    // collect POST values
    if (method == "POST") {
        Arc::PayloadRawInterface *in_payload = NULL;
        try {
            in_payload = dynamic_cast<Arc::PayloadRawInterface *>(in.Payload());
        } catch (std::exception &e) {
            throw InvalidMessageException();
        }
        // parse post values
        std::string post_content = in_payload->Content();
        // here assume the post value is in  one line 
        std::vector<std::string> lines;
        Arc::tokenize(post_content, lines, "&");
        for (int i = 0; i < lines.size(); i++) {
            std::vector<std::string> key_value;
            Arc::tokenize(lines[i], key_value, "=");
            if (key_value.size() >= 1) {
                std::string v = Arc::uri_unescape(Glib::strcompress(key_value[1]));
                POST[key_value[0]] = v; 
            }
        }
    }
    // set base_path
    std::string endpoint = in.Attributes()->get("HTTP:ENDPOINT");
    base_path = endpoint.substr(0, endpoint.rfind(path));
    if (base_path[base_path.size()] != '/') {
        base_path += '/';
    }
}

Here is the call graph for this function:

Definition at line 32 of file configurator.h.

{};

Definition at line 33 of file configurator.h.

{};

Member Data Documentation

Definition at line 29 of file configurator.h.

Definition at line 30 of file configurator.h.

Definition at line 28 of file configurator.h.

std::map<std::string, std::string> Paul::HTMLRequest::POST

Definition at line 27 of file configurator.h.


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