Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include "curl_easy.h"
  2.  
  3. using curl::curl_easy;
  4.  
  5. int main(int argc, const char **argv) {
  6.     curl_easy easy;
  7.     easy.add(curl_pair<CURLoption,string>(CURLOPT_URL,"http://www.google.it") );
  8.     easy.add(curl_pair<CURLoption,long>(CURLOPT_FOLLOWLOCATION,1L));
  9.     try {
  10.         easy.perform();
  11.     } catch (curl_easy_exception error) {
  12.         // If you want to get the entire error stack we can do:
  13.         vector<pair<string,string>> errors = error.what();
  14.         // Otherwise we could print the stack like this:
  15.         error.print_traceback();
  16.         // Note that the printing the stack will erase it
  17.     }
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement