Sample code for 30+ languages & platforms
C

HTTPS GET using SSL/TLS

See more HTTP Examples

To retrieve a resource using SSL/TLS (i.e. HTTPS), simply use a URL that begins with "https://". (This applies to any Chilkat HTTP method that has a URL argument, such as QuickGetStr, GetHead, QuickDeleteStr, etc.)

Chilkat C Downloads

C
#include <C_CkHttp.h>

void ChilkatSample(void)
    {
    HCkHttp http;
    const char *html;

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    http = CkHttp_Create();

    // Send the HTTP GET and return the content in a string.
    html = CkHttp_quickGetStr(http,"https://www.chilkatsoft.com/helloWorld.json");
    if (CkHttp_getLastMethodSuccess(http) == FALSE) {
        printf("%s\n",CkHttp_lastErrorText(http));
        CkHttp_Dispose(http);
        return;
    }

    printf("%s\n",html);


    CkHttp_Dispose(http);

    }