Sample code for 30+ languages & platforms
DataFlex

Example: Http.RemoveRequestHeader method

Demonstrates how to call the RemoveRequestHeader method.

Also see: Chilkat Http Default and Auto-Filled Headers

Chilkat DataFlex Downloads

DataFlex
Use ChilkatAx-win32.pkg

Procedure Test
    Boolean iSuccess
    Handle hoHttp
    String sResponseBody
    String sTemp1

    Move False To iSuccess

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    // Add a request header.
    Send ComSetRequestHeader To hoHttp "X-Something" "1234"

    Get ComQuickGetStr Of hoHttp "https://chilkatsoft.com/helloWorld.txt" To sResponseBody
    // Examine the request header we just sent..
    Get ComLastHeader Of hoHttp To sTemp1
    Showln sTemp1
    Showln "----"

    // Output:

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

    // Remove the request header we previously added:
    Send ComRemoveRequestHeader To hoHttp "X-Something"

    Get ComQuickGetStr Of hoHttp "https://chilkatsoft.com/helloWorld.txt" To sResponseBody
    Get ComLastHeader Of hoHttp To sTemp1
    Showln sTemp1

    // Output:

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


End_Procedure