27 #ifndef remote_http_resource_h_
28 #define remote_http_resource_h_
30 #include <curl/curl.h>
31 #include <curl/easy.h>
36 namespace httpd_catalog {
47 std::string d_remoteResourceUrl;
59 char d_error_buffer[CURL_ERROR_SIZE];
65 std::string d_resourceCacheFileName;
68 std::vector<std::string> *d_request_headers;
71 std::vector<std::string> *d_response_headers;
74 std::map<std::string,std::string> *d_http_response_headers;
80 void writeResourceToFile(
int fd);
86 void ingest_http_headers_and_type();
90 d_fd(0), d_initialized(
false), d_curl(0), d_resourceCacheFileName(
""), d_request_headers(0), d_response_headers(
91 0), d_http_response_headers(0)
118 throw BESInternalError(
"RemoteHttpResource::getCacheFileName() - STATE ERROR: Remote Resource Has Not Been Retrieved.", __FILE__, __LINE__);
119 return d_resourceCacheFileName;
131 throw BESInternalError(
"RemoteHttpResource::getCacheFileName() - STATE ERROR: Remote Resource Has Not Been Retrieved.", __FILE__, __LINE__);
132 hdrs.insert( hdrs.end(), d_response_headers->begin(), d_response_headers->end() );