building out asana client
This commit is contained in:
@@ -49,6 +49,8 @@ size_t asana_write_callback(void *contents, size_t size, size_t nmemb,
|
||||
Response *asana_fetch(char *path) {
|
||||
char url[ASANA_URL_MAX_LENGTH];
|
||||
snprintf(url, ASANA_URL_MAX_LENGTH, "https://app.asana.com/api/1.0/%s", path);
|
||||
|
||||
fprintf(stderr, "fetching %s\n", url);
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, asana_auth_header);
|
||||
@@ -62,6 +64,7 @@ Response *asana_fetch(char *path) {
|
||||
CURLcode result;
|
||||
result = curl_easy_perform(curl);
|
||||
if (result == CURLE_OK) {
|
||||
fprintf(stderr, "API Response:\n\n%s\n", response->body);
|
||||
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &(response->status));
|
||||
} else {
|
||||
response->status = 500;
|
||||
|
||||
Reference in New Issue
Block a user