mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-13 14:30:02 -04:00
add support for saving and loading cookies
This commit is contained in:
parent
d23703ff9a
commit
f8e55ea307
7 changed files with 65 additions and 12 deletions
|
@ -1,5 +1,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "cjson/cJSON.h"
|
||||
#include "curl/curl.h"
|
||||
|
@ -65,6 +66,11 @@ void http_set_options(CURL* http_handle, const char* json_params, const char* bo
|
|||
request_info->headers_list = headers_list;
|
||||
}
|
||||
|
||||
void http_set_cookie_jar(CURL* http_handle, const char* filename) {
|
||||
curl_easy_setopt(http_handle, CURLOPT_COOKIEFILE, filename);
|
||||
curl_easy_setopt(http_handle, CURLOPT_COOKIEJAR, filename);
|
||||
}
|
||||
|
||||
char* http_get_info(CURL* http_handle) {
|
||||
struct RequestInfo *request_info = get_request_info(http_handle);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue