W3C home > Mailing lists > Public > www-lib@w3.org > January to March 1999

Extra headers for POST

From: olga <olga@goliath.eai.com>
Date: Tue, 05 Jan 1999 11:40:15 -0600 (CST)
Message-ID: <XFMail.990105114015.olga@eai.com>
To: www-lib@w3.org
Hi,

I need to add extra headers for the POST request and it doesn't work. The
callback function which should generate the headers is never called. Am I doing
something wrong? 

Thanks,

Olga Antropova.

--------------------------------------------------------------

There is my code:

/////////////////// callback

int post_header_gen (HTRequest * request, HTStream * stream)
{ 
     char headers[1024];
     ...
     cerr << "\n======== post_header_gen: header = " << headers << endl;

    (*stream->isa->put_block)(stream, headers, strlen(headers));
    (*stream->isa->_free)(stream);
    
    return HT_OK;
}

////////////////// postURL

BOOL postURL(const char* server/* where to post */, 
             int port, 
             const char* url /* url of the script */, 
             const char* local_filename /*what to post */)

{ 
        ...

    //Set additional headers - add header generator
    BOOL override;
    
    HTList * generators = HTRequest_generator(request, &override);
    HTGenerator_add(generators, post_header_gen);
    HTRequest_setGenerator(request, generators, NO); //??? YES - NO
        
        ...

    // start POST request 
    BOOL status = HTPostAnchor(src, dst, request);
    
    return status;    
}
Received on Tuesday, 5 January 1999 14:10:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:28 GMT