libdap Updated for version 3.21.1
libdap4 is an implementation of OPeNDAP's DAP protocol.
|
#include <HTTPConnect.h>
Public Member Functions | |
HTTPResponse * | fetch_url (const std::string &url) |
HTTPConnect (RCReader *rcr, bool use_cpp=false) | |
bool | is_cache_enabled () const |
void | set_accept_deflate (bool deflate) |
void | set_cache_enabled (bool enabled) |
void | set_cookie_jar (const std::string &cookie_jar) |
void | set_credentials (const std::string &u, const std::string &p) |
void | set_use_cpp_streams (bool use_cpp_streams) |
void | set_xdap_protocol (int major, int minor) |
bool | use_cpp_streams () const |
virtual | ~HTTPConnect () |
Suppress default methods | |
These methods are not supported and are implemented here as protected methods to suppress the C++-supplied default versions (which will break this object). | |
HTTPConnect ()=delete | |
HTTPConnect (const HTTPConnect &)=delete | |
HTTPConnect & | operator= (const HTTPConnect &)=delete |
Friends | |
class | HTTPConnectTest |
class | HTTPThreadsConnectTest |
class | ParseHeader |
Use the CURL library to dereference a HTTP URL. Scan the response for headers used by DAP 2.0 and extract their values. The body of the response is made available using a FILE pointer.
Definition at line 51 of file HTTPConnect.h.
|
explicit |
Build a virtual connection to a remote data source that will be accessed using HTTP.
rcr | A pointer to the RCReader object which holds configuration file information to be used by this virtual connection. |
use_cpp | If true, use C++ streams and not FILE* for the data read off the wire. This can be changed later using the set_use_cpp_streams() method. |
Definition at line 516 of file HTTPConnect.cc.
|
delete |
|
delete |
|
virtual |
Definition at line 547 of file HTTPConnect.cc.
HTTPResponse * libdap::HTTPConnect::fetch_url | ( | const std::string & | url | ) |
Dereference a URL. This method dereferences a URL and stores the result (i.e., it formulates an HTTP request and processes the HTTP server's response). After this method is successfully called, the value of is_response_present() will be true and the methods get_response_headers(), type() and server_version() may be called.
url | The URL to dereference. |
Error | Thrown if the URL could not be dereferenced. |
InternalErr | Thrown if a temporary file to hold the response could not be opened. |
Definition at line 570 of file HTTPConnect.cc.
|
inline |
Return the current state of the HTTP cache.
Definition at line 158 of file HTTPConnect.h.
|
delete |
void libdap::HTTPConnect::set_accept_deflate | ( | bool | deflate | ) |
Set the accept deflate property. If true, the DAP client announces to a server that it can accept responses compressed using the deflate
algorithm. This property is automatically set using a value from the .dodsrc
configuration file. This method provides a way to override that behavior.
false
.deflate | True sets the accept deflate property, False clears it. |
Definition at line 903 of file HTTPConnect.cc.
|
inline |
Set the state of the HTTP cache. By default, the HTTP cache is enabled or disabled using the value of the USE_CACHE
property in the .dodsrc file. Use this method to set the state from within a program.
enabled | True to use the cache, False to disable. |
Definition at line 151 of file HTTPConnect.h.
|
inline |
Set the cookie jar. This function sets the name of a file used to store cookies returned by servers. This will help with things like single sign on systems.
cookie_jar | The pathname to the file that stores cookies. If this is the empty string saving cookies is disabled. |
Definition at line 141 of file HTTPConnect.h.
void libdap::HTTPConnect::set_credentials | ( | const std::string & | u, |
const std::string & | p ) |
Set the credentials for responding to challenges while dereferencing URLs. Alternatively, these can be embedded in the URL. This method provides a way for clients of HTTPConnect to get credentials from users (say using a pop up dialog) and to not hack the URL to pass that information to libcurl. Note that the 'credentials in the URL' scheme is part of the URL standard.
This method does nothing if u
, the username, is empty.
u | The username. |
p | The password. |
InternalErr | The credentials could not be registered with libcurl. |
Definition at line 963 of file HTTPConnect.cc.
|
inline |
Definition at line 130 of file HTTPConnect.h.
void libdap::HTTPConnect::set_xdap_protocol | ( | int | major, |
int | minor ) |
Set the xdap_accept property/HTTP-header. This sets the value of the DAP which the client advertises to servers that it understands. The information (client protocol major and minor versions) are recorded in the instance and the information is sent to servers using the XDAP-Accept HTTP request header.
major | The dap client major protocol version |
minor | The dap client minor protocol version |
Definition at line 928 of file HTTPConnect.cc.
|
inline |
Definition at line 128 of file HTTPConnect.h.
|
friend |
Definition at line 99 of file HTTPConnect.h.
|
friend |
Definition at line 101 of file HTTPConnect.h.
|
friend |
Definition at line 103 of file HTTPConnect.h.