topical media & game development

talk show tell print

lib-ch-example-ref-wcgi-setContentType.cgi / cgi



  #!/bin/ch
  /* Copyright (c) 2001 by SoftIntegration, Inc. All Rights Reserved */
  include <wcgi.h>
  
  int main() {
    class CResponse Response;
    chchar *contentType_def, *contentType_cur;
  
    // get default content type
    contentType_def = Response.getContentType();
  
    // set current content type to "text/plain"
    Response.setContentType(L"text/plain");
  
    // get current content type
    contentType_cur = Response.getContentType();
  
    Response.begin();
    printf("Test of Response.setContentType and Response.getContentType\n");
  
    printf("The Default Content Type is : ");
    fputws(contentType_def ? contentType_def : L"(null)", stdout);
    printf("\n");
  
    printf("The Current Content Type is : ");
    fputws(contentType_cur ? contentType_cur : L"(null)", stdout);
    printf("\n");
  
    Response.end();
  }
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.