topical media & game development

talk show tell print

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



  #!/bin/ch
  /* Copyright (c) 2001 by SoftIntegration, Inc. All Rights Reserved */
  include <wcgi.h>
  
  int main() {
    class CResponse Response;
    chchar *status_def, *status_cur;
  
    // get the default value of the status line
    status_def = Response.getStatus();
  
    // set the new status line
    Response.setStatus(L"400 Bad Request");
    //Response.setStatus(L"401-1 Unauthorized");
  
    // get current value of the status line
    status_cur = Response.getStatus();
  
    Response.begin();
    Response.title(L"Test of Response.setStatus and Response.getStatus");
    printf("<H1> Test of Response.setStatus and Response.getStatus </H1> 
\n"); printf("The default value of the status line is : "); fputws(status_def ? status_def : L"(null)", stdout); printf(" <br>\n"); printf("The current value of the status line is : "); fputws(status_cur ? status_cur : L"(null)", stdout); printf(" <br>\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.