Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <curl/curl.h>
- #define OK 0
- #define INIT_ERR 1
- #define REQ_ERR 2
- #define URL "http://10.0.2.15:8000"
- int main(void) {
- CURL *curl;
- CURLcode res;
- curl = curl_easy_init();
- if (curl) {
- curl_easy_setopt(curl, CURLOPT_URL, URL);
- curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
- res = curl_easy_perform(curl);
- if(res != CURLE_OK) {
- return REQ_ERR;
- }
- curl_easy_cleanup(curl);
- } else {
- return INIT_ERR;
- }
- return OK;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement