libcurl

PHP - curl_exec hangs

时间秒杀一切 提交于 2020-01-22 13:18:25
问题 I am having a strange problem with the below php function. Unfortunately this is one of those special "Production only" case. function requestPost($url, $data) { set_time_limit(60); $output = array(); $curlSession = curl_init(); if($curlSession == false) syslog(LOG_INFO,"Falied to create a curl sessions"); // Set the URL curl_setopt ($curlSession, CURLOPT_URL, $url); // No headers, please curl_setopt ($curlSession, CURLOPT_HEADER, 0); // It's a POST request curl_setopt ($curlSession, CURLOPT

QT导入libcurl支持HTTPS

£可爱£侵袭症+ 提交于 2020-01-19 12:34:33
对于我这种不会编译的人来说,必须找到已经编译好的DLL文件,以及头文件才能使用。 幸运的在这个网站https://stackoverflow.com/questions/28137379/libcurl-win32-static-with-ssl,也有人提问相同的问题,所以就这儿工具找到了已经编译好的文件链接,直接下载就行。 我的工具环境使用的是WIN32,所以只能下载对应的文件 libcURL for Win32 is here http://curl.haxx.se/gknw.net/7.40.0/dist-w32/curl-7.40.0-devel-mingw32.zip , 至于在QT导入libcurl文件就容易的多了,在pro文件最下面写入 LIBS += D:\QTitem\MyTest\curl\libcurldll.a INCLUDEPATH += D:\QTitem\MyTest\curl\include注意 curl这里是我电脑自己存放所有libcURL文件的路径,改成你自己的。这里并没有完成,如果你不做接下来这一步,将会收到错误提示。例如: Starting D:\QTitem\MyTest\debug\MyTest.exe... 程序异常结束。 D:\QTitem\MyTest\debug\MyTest.exe crashed. 为了避免这个错误出现

Using libcurl on windows, in my c++ project, with visual studio, does not work because string get corrupted

淺唱寂寞╮ 提交于 2020-01-16 17:36:28
问题 As explained in the title, I am trying to use the libcurl C API to submit simple http query. I am using windows as an OS, C++ as a language, Visual Studio 2008 as an IDE. My code is quiet simple: I initialize curl: CURLcode init = curl_global_init(CURL_GLOBAL_ALL); I initialize my handle: CURL* handle = curl_easy_init(); I set the url: CRULcode set_url = curl_easy_setopt(handle, CURLOPT_URL, "http://www.example.com") I submit my request: CURLcode submit = curl_easy_perform(handle); As a

Using libcurl on windows, in my c++ project, with visual studio, does not work because string get corrupted

风格不统一 提交于 2020-01-16 17:36:20
问题 As explained in the title, I am trying to use the libcurl C API to submit simple http query. I am using windows as an OS, C++ as a language, Visual Studio 2008 as an IDE. My code is quiet simple: I initialize curl: CURLcode init = curl_global_init(CURL_GLOBAL_ALL); I initialize my handle: CURL* handle = curl_easy_init(); I set the url: CRULcode set_url = curl_easy_setopt(handle, CURLOPT_URL, "http://www.example.com") I submit my request: CURLcode submit = curl_easy_perform(handle); As a

How to make the libcurl send digest authentication header in each http packet?

南笙酒味 提交于 2020-01-16 02:56:20
问题 I have the following function http_send_message() wich I use each time I want to send a http message: http_send_message(char *msg_out, char **msg_in) { CURLcode res; CURL *curl; curl = curl_easy_init(); if (!curl) return -1; curl_easy_setopt(curl, CURLOPT_URL, "http://192.168.1.133:8080/tawtaw"); curl_easy_setopt(curl, CURLOPT_USERNAME, "tawtaw"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "tawtaw"); curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC|CURLAUTH_DIGEST); . . . curl_easy

How to make the libcurl send digest authentication header in each http packet?

坚强是说给别人听的谎言 提交于 2020-01-16 02:56:15
问题 I have the following function http_send_message() wich I use each time I want to send a http message: http_send_message(char *msg_out, char **msg_in) { CURLcode res; CURL *curl; curl = curl_easy_init(); if (!curl) return -1; curl_easy_setopt(curl, CURLOPT_URL, "http://192.168.1.133:8080/tawtaw"); curl_easy_setopt(curl, CURLOPT_USERNAME, "tawtaw"); curl_easy_setopt(curl, CURLOPT_PASSWORD, "tawtaw"); curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC|CURLAUTH_DIGEST); . . . curl_easy

Can libcurl be used to make multiple concurrent requests?

為{幸葍}努か 提交于 2020-01-16 00:38:12
问题 I am using libcurl for one of my projects. I know that curl is not used to make multiple concurrent requests but does libcurl support it? I know there are other tools like ab but that there are many features that libcurl provides. Again I know I can use curl within script to run multiple requests,but that's not what I am looking for. I could not find a satisfactory answer for this expect this one. Although, It's not conclusive. I should be able to use multiple handles for multiple connections

libcurl compile errors

╄→尐↘猪︶ㄣ 提交于 2020-01-15 05:20:09
问题 I use libcurl and I get these errors without writting any code just compiling and I don't know why Fehler 49 error C2628: '$UnnamedClass$0x05e5b255$395$' gefolgt von 'bool' unzulässig (Semikolon ';' vergessen?) c:\users\ttg\desktop\curl-7.21.7\lib\setup_once.h 273 Fehler 50 error C2065: '_SH_DENYNO': nichtdeklarierter Bezeichner C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xiosbase 111 first is a libcurl file and it says it's followed by bool(forgot semicolon?) second

Cancel libcurl easy handle

寵の児 提交于 2020-01-14 10:08:23
问题 Is there an easy way to cancel a curl_easy_perform from another thread? 回答1: You have to use the callback functions (write/read/progress) to perform the cancel. The other thread needs to set a flag and the callback function checks the flag and returns the proper value to cancel the operation. 来源: https://stackoverflow.com/questions/235763/cancel-libcurl-easy-handle

error: Invalid Signature when uploading files on dropbox

一曲冷凌霜 提交于 2020-01-14 05:40:14
问题 I am trying to develop a desktop application that uses dropbox. I am using C++, libcurl (for the requests) liboauthcpp (for the authentication) and the Rest API (from dropbox). Since I have successed the authentication and some more operations (list and download file), I cannot manage to upload a file. I am receiving the following error: {"error": "Invalid signature."} Here is my code: m_upload_url = "https://api-content.dropbox.com/1/files/sandbox/"; OAuth::Consumer consumer(m_consumer_key,