libapp_3.c
上传用户:zlh9724
上传日期:2007-01-04
资源大小:1991k
文件大小:1k
源码类别:

浏览器

开发平台:

Unix_Linux

  1. #include "WWWLib.h"
  2. #include "WWWHTTP.h"
  3. #include "WWWMIME.h"
  4. #include "WWWApp.h"
  5. int main (int argc, char ** argv)
  6. {
  7.     HTList * converters = HTList_new();
  8.     HTRequest * request = HTRequest_new();   /* Create a request object */
  9.     HTLibInit("TestApp", "1.0");
  10.     HTProtocol_add("http", YES, HTLoadHTTP, NULL);
  11.     HTConversion_add(converters, "text/x-http","*/*", HTTPStatus_new,
  12.      1.0, 0.0, 0.0);
  13.     HTConversion_add(converters, "message/rfc822", "*/*", HTMIMEConvert,
  14.      1.0, 0.0, 0.0);
  15.     HTFormat_setConversion(converters);
  16.     HTAlert_add(HTPrompt, HT_A_PROMPT);
  17.     if (argc == 2) {
  18. HTLoadAbsolute(argv[1], request);
  19.     } else
  20. printf("Type the URL to fetchn");
  21.     HTRequest_delete(request); /* Delete the request object */
  22.     HTConversion_deleteAll(converters);
  23.     HTLibTerminate();
  24.     return 0;
  25. }