I am using cURL to fetch information from servers.
This is the query URL I get "http://md5.jsontest.com/?text=Fri Jun 13 2014 07:41:27 GMT+0300 (EEST)"
When this is directly hit through browser I get proper response as below
{
"md5": "c22f2d0c39cb6c9f15c170fbedfab634",
"original": "Fri Jun 13 2014 07:41:27 GMT 0300 (EEST)"
}
But When I try it with cURL example i get 406 error. Below is my sample code
int main(void)
{
CURL *curl;
CURLcode res;
int data2len;
char* temp = "http://md5.jsontest.com/?text=Fri Jun 13 2014 07:41:27 GMT+0300 (EEST)";
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL,temp );
/* example.com is redirected, so we tell libcurl to follow redirection */
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
/* Perform the request, res will get the return code */
res = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
/* always cleanup */
curl_easy_cleanup(curl);
}
return 0;
}
Kindly help !! Thanks in advance.