Sha256: 109ffa612b048e821b4b27546eff799c0dfee20dcd2701a8af7711fd2f3bbf0d

Contents?: true

Size: 1.57 KB

Versions: 6

Compression:

Stored size: 1.57 KB

Contents

#ifndef RHO_CURL_NET_REQUEST_041be6266e3e424c8a8e7b8a412f01f0
#define RHO_CURL_NET_REQUEST_041be6266e3e424c8a8e7b8a412f01f0

//#include "curl/lib/setup.h"
#include "curl/curl.h"
#include "net/INetRequest.h"
#include "logging/RhoLog.h"

namespace rho
{
namespace net
{

class CURLNetRequest : public INetRequest
{
    DEFINE_LOGCLASS;
public:
    CURLNetRequest();
    ~CURLNetRequest();

    INetResponse *pullData(const String& strUrl, IRhoSession *oSession);
    INetResponse *pushData(const String& strUrl, const String& strBody, IRhoSession *oSession);
    INetResponse *pushFile(const String& strUrl, const String& strFileName, IRhoSession *oSession, Hashtable<String,String>* pHeaders);
    INetResponse *pullFile(const String& strUrl, const String& strFilePath, IRhoSession *oSession, Hashtable<String,String>* pHeaders);
    INetResponse *pullCookies(const String& strUrl, const String& strBody, IRhoSession *oSession);
    INetResponse* doRequest( const char* method, const String& strUrl, const String& strBody, IRhoSession* oSession, Hashtable<String,String>* pHeaders );

    String resolveUrl(const String& strUrl);

    void cancel();
    virtual boolean isCancelled(){return m_bCancel;}

private:
	int getResponseCode(CURLMcode err, const String& strRespBody, IRhoSession* oSession);
	String makeCookies();
    INetResponse *makeResponse(String strBody, int nErrorCode);
	
    boolean m_bCancel;
	CURLM *curlm;
    CURL *curl;
    char *errbuf[CURL_ERROR_SIZE];
    boolean m_bTraceCalls;
};

} // namespace net
} // namespace rho

#endif // RHO_CURL_NET_REQUEST_041be6266e3e424c8a8e7b8a412f01f0

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rhodes-1.5.5 platform/shared/net/CURLNetRequest.h
rhodes-1.5.4 platform/shared/net/CURLNetRequest.h
rhodes-1.5.3 platform/shared/net/CURLNetRequest.h
rhodes-1.5.2 platform/shared/net/CURLNetRequest.h
rhodes-1.5.1 platform/shared/net/CURLNetRequest.h
rhodes-1.5.0 platform/shared/net/CURLNetRequest.h