0

i am new to RAD studio C++, so please don't mind if i ask very basic questions here.

I have created a "Web Server application" (GUI standalone) from the RAD Studio project templates. This gives me a "WebModule" with related .cpp and .h file. I have added actions to the WebModule (might be called "endpoints" as well and those are called when i send requests to the WebServer. This works fine.

For example on GET request, this method gets called:

void __fastcall TWebModule1::WebModule1WebActionItem2Action(TObject *Sender, TWebRequest *Request,
          TWebResponse *Response, bool &Handled)
{
        /* On Get Action */
        /* How to retrieve the request informations ?? */
    Response->Content =
    "<html>"
    "<head><title>Web Server Application</title></head>"
    "<body>Action 2: CALLED</body>"
    "</html>";
}

However, in the method itself i can not access the request data such as URL. Is there something i am missing or is this because the "WebDispatcher" has already deleted the URL from the request?

In addition, is there any option to instantiate a "WebModule" directly in the source code rather than dragging and dropping and editing a design element?

I have viewed the References on the Embarcadero site for the classes used in the example, but i must admit that it does not answer my question in a way that i understand.

I'd be glad if someone could point me to a specific example/ documentation page or give a hint what i can try.

Thanks a lot and kind regards

What i did was -Created a webserver project -added some "WebActionItem" to the "WebModule" by using the IDEs "design tool" -ran the application in debug mode and tried to access fields of the "WebRequest"

-> URL property of "TWebRequest *Request" (see code above) for example is empty.

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.