title: cURL couldn't resolve host, but web browser can access it
body: <p>I'm writing my server code in C on my Mac, and I need it to access Facebook's Graph API at the URL "https://graph.facebook.com/app?access_token=[insert access token here]". I'm getting a CURLE_COULDNT_RESOLVE_HOST error, maybe because I've never done this before and am probably doing something totally wrong. I'm setting up a CURL* and connecting like this:</p>
  
  <pre><code>curl = curl_easy_init();
  curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, true);
  curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 2);
  curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8");
  char* httpURLFormat = "https://graph.facebook.com/app?access_token=%s";
  char* httpURL = emalloc(sizeof(char)*(strlen(httpURLFormat)+MAX_TOKEN_LENGTH)); //emalloc is just malloc that makes sure there is free memory
  sprintf(httpURL, httpURLFormat, data-&gt;password); //data-&gt;password is the access token
  curl_easy_setopt(curl, CURLOPT_URL, &amp;httpURL);
  curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
  struct url_data response; //this struct contains int size and char* data
  response.size = 0;
  response.data = emalloc(4096);
  curl_easy_setopt(curl, CURLOPT_WRITEDATA, &amp;response);
  CURLcode curlCode = curl_easy_perform(curl);
  if (curlCode!=CURLE_OK){
      printf("curl failed!!!\n"); //this ends up printing
      free(response.data);
      free(httpURL);
      free(httpURLFormat);
      return false;
  }
  //Yes, I free everything left over afterwards...
  </code></pre>
  
  <p>I tested the URL it's connecting to in my web browser using the same user agent my code uses, and it connects without trouble. I tried adding a '\n' character to the end of the URL, and my code still won't work.</p>