Sample code for 30+ languages & platforms
Unicode C++

Example: Http.HasRequestHeader method

Demonstrates the HasRequestHeader method.

Chilkat Unicode C++ Downloads

Unicode C++
#include <CkHttpW.h>

void ChilkatSample(void)
    {
    CkHttpW http;

    http.SetRequestHeader(L"X-CSRF-Token",L"Fetch");

    bool b = http.HasRequestHeader(L"X-CSRF-Token");
    if (b == true) {
        wprintf(L"X-CSRF-Token: Yes\n");
    }
    else {
        wprintf(L"X-CSRF-Token: No\n");
    }

    b = http.HasRequestHeader(L"X-Something");
    if (b == true) {
        wprintf(L"X-Something: Yes\n");
    }
    else {
        wprintf(L"X-Something: No\n");
    }

    //  The Accept and Accept-Encoding headers are default headers automatically added,
    //  unless the application chooses to remove by calling RemoveRequestHeader for each.
    b = http.HasRequestHeader(L"Accept");
    if (b == true) {
        wprintf(L"Accept: Yes\n");
    }
    else {
        wprintf(L"Accept: No\n");
    }

    //  Output:

    //  X-CSRF-Token: Yes
    //  X-Something: No
    //  Accept: Yes
    }