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

Example: Http.RemoveRequestHeader method

Demonstrates how to call the RemoveRequestHeader method.

Also see: Chilkat Http Default and Auto-Filled Headers

Chilkat Unicode C++ Downloads

Unicode C++
#include <CkHttpW.h>

void ChilkatSample(void)
    {
    bool success = false;

    CkHttpW http;

    //  Add a request header.
    http.SetRequestHeader(L"X-Something",L"1234");

    const wchar_t *responseBody = http.quickGetStr(L"https://chilkatsoft.com/helloWorld.txt");
    //  Examine the request header we just sent..
    wprintf(L"%s\n",http.lastHeader());
    wprintf(L"----\n");

    //  Output:

    //  GET /helloWorld.txt HTTP/1.1
    //  Host: chilkatsoft.com
    //  Accept: */*
    //  Accept-Encoding: gzip
    //  X-Something: 1234

    //  Remove the request header we previously added:
    http.RemoveRequestHeader(L"X-Something");

    responseBody = http.quickGetStr(L"https://chilkatsoft.com/helloWorld.txt");
    wprintf(L"%s\n",http.lastHeader());

    //  Output:

    //  GET /helloWorld.txt HTTP/1.1
    //  Host: chilkatsoft.com
    //  Accept: */*
    //  Accept-Encoding: gzip
    }