Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

CGI Write Reply VI

LabVIEW Internet Toolkit 6.0.2 Help
June 2008

NI Part Number:
370014C-01

»View Product Info

Owning Palette: CGI Template VIs

Installed With: Internet Toolkit

Writes a reply to the HTTP connections that the cgi connection info input specifies.

Details  

cgi connection info contains information about a specific CGI connection. Wire the cgi connection info output of the CGI Read Request VI to this input.
header contains the header section of the reply, which traditional parsed-header CGI applications write to standard out.
content contains the content data part of the reply, which traditional parsed-header CGI applications write to standard out. If you do not specify a header string, the content string must be an HTML document.
cgi connection info out returns the same value as cgi connection info.

CGI Write Reply Details

An HTTP reply consists of a header followed by content. The default behavior of the server is to construct a header that implies a success status (200) and content consisting of HTML text (text/html). If the CGI VI must override this default behavior, it uses the header parameter. Create a header that contains parameter lines of server directives or HTTP header lines. The server can interpret server directives, while other header lines are written as part of the header sent to the client. If the first line in the header begins with HTTP/, the server does not parse the header for directives but sends it directly to the client.

The CGI/1.1 specification defines the following three server directives:

  • Content-type: type/subtype—Specifies the MIME type of the document you are returning.
  • Location: URL—Specifies to the server that you are returning a reference to a document rather than an actual document. The sender sends the client a redirect (304) reply status.
  • Status: status line—Specifies the HTTP/1.0 status line to send to the client, using the format nnn xxxxx, where nnn is the 3-digit status code and xxxxx is the reason string, such as Forbidden.

According to HTTP specification, the server replaces end-of-line characters with the CRLF character sequence before sending the header to the client.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit