Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
C++

How to make RESTful WebBroker using C++Builder

Author: Andrea L59044

 

I used FireDAC because I wanted to make a DB connection to MySQL DB.

Resource and suffix can be obtained with Request->PathInfo.

So decompose PathInfo into std::vector<UnicodeString> and put it in.

 

We made each resource as a member function.

 

And I set it on the map.

 

Call from the main action function.

Each resource implementation part.

It is the code below.

http://localhost:8080/resource1/1

Accessing the above URL goes through the function of WebModule1WebActionResource1.

This function connects to DB using FireDAC.

 

http://localhost:8080/resource2/japan/America/2017

The above URL goes through the function of WebModule1WebActionResource2.

This is just a function to echo the item.

Two resource functions are returned by JSON.

 

[gist]

https://gist.github.com/mojeld/63592be8f6c371116f2145b37c2a54aa 

 


What's New for RAD Studio 11

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

Related posts
CodeDelphiRAD Studio

This Is How To Easily Process CSV Data Using FireDAC

C++Code

This Week's New C++ Post Picks From LearnCPlusPlus.org

CodeDatabaseDelphiRAD Studio

6 Easy Ways to Connect to the Top Databases You Should Know

C++CodeDelphiTech Partner

How To Add Website Metrics To Your Apps Right Now

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES