W3C home > Mailing lists > Public > www-lib@w3.org > July to September 1998

HTTP PUT app problem

From: Matthew P. Bohnsack <bohnsack@eai.com>
Date: Fri, 07 Aug 1998 11:39:55 -0500
Message-Id: <199808071637.LAA06499@goliath.eai.com>
To: www-lib@w3.org
Hello.. I've been trying to get a small HTTP PUT app on UNIX with 
libwww working.  Basically, I'm trying to replicate the command line tool:
w3c -put /home/bohnsack/WWW/me.jpg -dest http://merced/put_test

After some looking through HTLine.c, the following code is my attempt 
to create an HTTP PUT client.  The program isn't even making a connection
to the web server.  Can someone with wisdom greater than my own, give me
a suggestion on how to get this small app working?

Thanks for your help.. -matt

void main (void)
{
    HTRequest *request;
    BOOL status;
    char * url = "http://merced/put_test";
    char * file = "/home/bohnsack/WWW/me.jpg";

	  request = HTRequest_new();

    if( request )
    {
        HTParentAnchor * destination;    
        HTParentAnchor * source = NULL;

        printf("Got a request\n");

        destination = (HTParentAnchor *) HTAnchor_findAddress( url );
        source = (HTParentAnchor *) HTAnchor_findAddress( file );
        HTAnchor_setLength(source, 6270 );

        status = HTPutDocumentAnchor( source, (HTAnchor *) destination,
request );
        printf("\nstatus = %d\n",status);

        HTRequest_delete( request );

    }
    else
    {
        printf("\nno request!!!\n");
    }
}

--
Matt Bohnsack                Engineering Animation, Inc.
bohnsack@eai.com             http://www.eai.com
515.296.0964
Received on Friday, 7 August 1998 12:34:36 GMT

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