HTTP_CONTENT_TRANSFER_ENCODING

Q&A's, tips, howto's
Locked
dexter
Posts: 74
Joined: Fri Nov 11, 2011 12:55 am

HTTP_CONTENT_TRANSFER_ENCODING

Post by dexter »

Is this var/symbol exstied in newlisp?

I found this code in dragonfly framework,but I googled this, found nothing match it.

http://code.google.com/p/dragonfly-newl ... 59d95e46d6

Code: Select all

    (if (and (setf temp HTTP_CONTENT_TRANSFER_ENCODING) (= temp "binary"))
        (handle-binary-data)
        (and (setf temp CONTENT_TYPE) (starts-with temp "multipart/form-data"))
        (handle-multipart-data)
        (and (read (device) temp MAX_POST_LENGTH) temp)
        (dolist (pair (parse-query temp))
            (add-keyvalue-to-ctx (first pair) (last pair) $POST)
        )   
    )  
What is this HTTP_CONTENT_TRANSFER_ENCODING for?

Kirill
Posts: 90
Joined: Wed Oct 31, 2007 1:21 pm

Re: HTTP_CONTENT_TRANSFER_ENCODING

Post by Kirill »

HTT_CONTENT_TRANSFER_ENCODING is environment variable, created from the Content-Transfer-Encoding request header.

You can continue searching for Content-Transfer-Encoding, but in short, it tells how incoming data are encoded.

dexter
Posts: 74
Joined: Fri Nov 11, 2011 12:55 am

Re: HTTP_CONTENT_TRANSFER_ENCODING

Post by dexter »

thanks

I just want to know , it this created by newlisp or else?

I can not find this HTTP_CONTENT_TRANSFER_ENCODING in newlisp codes
But dragonfly used it

So I wonder where it come from?

Kirill
Posts: 90
Joined: Wed Oct 31, 2007 1:21 pm

Re: HTTP_CONTENT_TRANSFER_ENCODING

Post by Kirill »

Ah, it's set by the web server. Here's what CGI 1.1 specification says about HTTP_* environment variables:

Code: Select all

 HTTP_*

      These variables are specific to requests made with HTTP.
      Interpretation of these variables may depend on the value of
      SERVER_PROTOCOL.

      Environment variables with names beginning with "HTTP_" contain
      header data read from the client, if the protocol used was HTTP.
      The HTTP header name is converted to upper case, has all
      occurrences of "-" replaced with "_" and has "HTTP_" prepended to
      give the environment variable name. The header data may be
      presented as sent by the client, or may be rewritten in ways which
      do not change its semantics. If multiple headers with the same
      field-name are received then they must be rewritten as a single
      header having the same semantics. Similarly, a header that is
      received on more than one line must be merged onto a single line.
      The server must, if necessary, change the representation of the
      data (for example, the character set) to be appropriate for a CGI
      environment variable.

      The server is not required to create environment variables for all
      the headers that it receives. In particular, it may remove any
      headers carrying authentication information, such as
      "Authorization"; it may remove headers whose value is available to
      the script via other variables, such as "Content-Length" and
      "Content-Type".

Locked