Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rafaeljusto/cgiplus
Tiny C++ tool to parse web requests
https://github.com/rafaeljusto/cgiplus
Last synced: about 10 hours ago
JSON representation
Tiny C++ tool to parse web requests
- Host: GitHub
- URL: https://github.com/rafaeljusto/cgiplus
- Owner: rafaeljusto
- License: gpl-3.0
- Created: 2011-06-30T20:28:48.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-05-16T12:01:44.000Z (over 12 years ago)
- Last Synced: 2024-05-01T20:39:42.959Z (7 months ago)
- Language: C++
- Homepage: http://rafael.net.br/EN/projects/CGIplus/
- Size: 470 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
CGIplus
=======**CGIplus** is a C++ tool to parse CGI requests. Some features that
you will find:* Easy interface - use [] and () operators to get (Cgi) or define
(Builder) GET/POST data and Cookie respectively* Protection against cross-site scripting - Some special symbols are
removed from the input dataPrerequisits
------------* g++ 4.6 -
* python 2.7 -
* scons 2.0 -
* libboost-system-dev 1.4 -
* libboost-test-dev 1.4 -
* libboost-regex-dev 1.4 -The project was compiled using the above compilers and libraries,
higher versions should work well.Installation
------------Define the compiler using the CXX environment variable, by default
is used "g++".# scons
# scons installFor API documentation:
# scons doc
Usage
-----Source code:
#include
#include
#include
int main()
{
// Simulating inputs
setenv("QUERY_STRING", "test=abc123", 1);
setenv("REQUEST_METHOD", "GET", 1);
string form = "The test has as content: ";
cgiplus::Cgi cgi;
cgiplus::Builder builder;
builder.setForm(form);
builder["content"] = cgi["test"];
builder.show();return 0;
}Compliling:
g++ -std=c++0x test.cpp -o test -lcgiplus -lboost_regex
Output:
Content-type: text/html
The test has as content: abc123
Contact
-------Rafael Dantas Justo
License
-------CGIplus Copyright (C) 2012 Rafael Dantas Justo
This file is part of CGIplus.
CGIplus is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.CGIplus is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with CGIplus. If not, see .