AFLOW
 
Loading...
Searching...
No Matches
aurostd_xhttp.cpp File Reference
#include "aurostd_xhttp.h"
#include <array>
#include <cerrno>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <ios>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include <vector>
#include <curl/curl.h>
#include <curl/easy.h>
#include <curl/header.h>
#include "aurostd.h"
#include "aurostd_automatic_template.h"
#include "aurostd_xerror.h"
#include "aurostd_xfile.h"
#include "aflow_xhost.h"

Go to the source code of this file.

Namespaces

namespace  aurostd
 

Macros

#define _AUROSTD_XHTTP_CPP_
 
#define _DEBUG_XHTTP_   false
 
#define AST_TEMPLATE(utype)
 

Functions

void aurostd::httpGet (const string &url, std::string &output, long &response_code, std::map< std::string, std::string > &header)
 get a web resource as string
 
void aurostd::httpGetFile (const string &url, const std::string &filename, long &response_code, std::map< std::string, std::string > &header)
 get a web resource as file
 
long aurostd::httpGetStatus (const std::string &url)
 Retrieve data from an url.
 
long aurostd::httpGetStatus (const std::string &url, std::string &output)
 Retrieve data from an url.
 
long aurostd::httpGetStatus (const std::string &url, std::string &output, std::map< std::string, std::string > &header)
 Retrieve data from an url.
 
long aurostd::httpGetStatus (const std::string &host, const std::string &path, const std::string &query, std::string &output)
 Retrieve data from url components.
 
long aurostd::httpGetStatus (const std::string &host, const std::string &path, const std::string &query, std::string &output, std::map< std::string, std::string > &header)
 Retrieve data from url components.
 
std::string aurostd::httpGet (const std::string &url)
 Retrieve data from an url.
 
std::string aurostd::httpGet (const std::string &url, long &response_code)
 Retrieve data from an url.
 
std::string aurostd::httpGet (const std::string &url, long &response_code, std::map< std::string, std::string > &header)
 Retrieve data from an url.
 
long aurostd::httpGetFileStatus (const std::string &url, const std::string &filename)
 Download data as file.
 
long aurostd::httpGetFileStatus (const std::string &url, const std::string &filename, std::map< std::string, std::string > &header)
 download data as file
 
template<typename utype>
size_t aurostd::httpGetTokens (const string &url, vector< utype > &tokens, const string &delimiters)
 get the data split into tokens
 
std::string aurostd::httpGetCompressedFileContent (const string &url, long &response_code, std::map< std::string, std::string > &header)
 get the content of a file from the web, decompress locally if needed
 
std::string aurostd::httpGetCompressedFileContent (const string &url, long &response_code)
 get the content of a file from the web, decompress locally if needed
 
std::string aurostd::httpGetCompressedFileContent (const string &url)
 get the content of a file from the web, decompress locally if needed
 
string aurostd::httpPercentEncodingFull (string work_str)
 Fully percent encode a string.
 

Macro Definition Documentation

◆ _AUROSTD_XHTTP_CPP_

#define _AUROSTD_XHTTP_CPP_

Definition at line 12 of file aurostd_xhttp.cpp.

◆ _DEBUG_XHTTP_

#define _DEBUG_XHTTP_   false

Definition at line 45 of file aurostd_xhttp.cpp.

◆ AST_TEMPLATE

#define AST_TEMPLATE ( utype)
Value:
template size_t httpGetTokens(const string&, std::vector<utype>&, const string&);

Definition at line 371 of file aurostd_xhttp.cpp.