?
Solved

about http return header

Posted on 2003-02-19
11
Medium Priority
?
233 Views
Last Modified: 2010-04-15
Can anyone tell what's the meaning of these http return headers and how and when to generate these headers?

DateFiuse GMTj
Last-ModifiedFiuse GMTj
WWW-AuthenticateF
LocationF
ConnectionFclose
Cache-controlFno-cache

Your help is grealy appreciated.


0
Comment
Question by:yaoming
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
  • +1
11 Comments
 
LVL 8

Expert Comment

by:ssnkumar
ID: 7985321
This header is the response header generated by a web server, when the browser asked for some request.
But, the first line has to the "HTTP version Code Phrase". I am not seeing it in the header you have posted. Since that line is missing, I don't think you have posted the complete header!
Last-Modified.... will tell the client that the page requested was last modified on that date/time. This is useful for sites which keeps updating the contents (like News sites). The web client maintains a cache and can take the page from there itself, if the page is not modified. Else it requests for a fresh page.
WWW-Authenticate.....tells the client that authentication is needed.
Connection: close
This is part of the request HTTP header, not of response header.

-Narendra
0
 

Author Comment

by:yaoming
ID: 7991514
hi,
can you tell me how to get last modified time using C/C++
and how the server determines whether the web client maintains a cache or not and how does it implemented using a programming language?

Thanx For Your Help!
0
 
LVL 5

Expert Comment

by:msa2003
ID: 8003205
It looks like you used non-windows-1252 codepage to enter your question, so I can't read it. Couldn't you re-enter it in U. S. english?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:yaoming
ID: 8006318
hi,msa2003,
thanx for your help.
I have known the answers to most of the questions that i asked.
I'm now developing a simple web server using C and C++ which can process get,head method and basic authentication.

Can you tell me how the basic authentication is realized?
 
0
 
LVL 8

Expert Comment

by:ssnkumar
ID: 8006442
Do you want to know the last modified time of the file on your system OR the syntax of the header in HTTP/1.1?
Which is the OS you are using?

-Narendra
0
 
LVL 5

Expert Comment

by:msa2003
ID: 8009447
Re yaoming: see RFC-2068, section 11.1:

The "basic" authentication scheme is based on the model that the user agent must authenticate itself with a user-ID and a password for each realm. The realm value should be considered an opaque string which can only be compared for equality with other realms on that server.
The server will service the request only if it can validate the user-ID and password for the protection space of the Request-URI. There are no optional authentication parameters. Upon receipt of an unauthorized request for a URI within the protection space, the server MAY respond with a challenge like the following:

          WWW-Authenticate: Basic realm="WallyWorld"

   where "WallyWorld" is the string assigned by the server to identify the protection space of the Request-URI. To receive authorization, the client sends the userid and password, separated by a single colon (":") character, within a base64  encoded string in the credentials.

          basic-credentials = "Basic" SP basic-cookie
          basic-cookie   = <base64 [7] encoding of user-pass, except not limited to 76 char/line>
          user-pass   = userid ":" password
          userid      = *<TEXT excluding ":">
          password    = *TEXT

   Userids might be case sensitive.

   If the user agent wishes to send the userid "Aladdin" and password "open sesame", it would use the following header field:

          Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

   I think it is clear enough.
0
 

Author Comment

by:yaoming
ID: 8023107
hi,can you tell me how can i encode base64 string to normal string? any code available?

0
 
LVL 8

Accepted Solution

by:
ssnkumar earned 80 total points
ID: 8023133
You will need a decoder which can do that. In Linux machine, uuencode/uudecode will do that. Similar thing must be available on windows too.

-Narendra
0
 
LVL 5

Expert Comment

by:msa2003
ID: 8026720
The base64 encoding method is ckearly described in RFC-822 (as I remember).

It is complex enough. It is difficult to place it here because the description contains two large encoding tables.

You may read RFC-822 for details or I could write a DLL (sorry, but I think that it will take some additional points because it is another question).

base64 encoding is used to encode raw 8-bit values using only the symbols of Latin alphabet. They are 62 alphabet symbols (including capitals) and two additional ("+" and "/") - overall 64. 64 values is 6 bits, so we need to transform a series of 8-bit values to 6-bit. 3 bytes is equal to 24 bits or 4 6-bit values. So we are taking 24-bit triplet (which is easy using 32-bit programming) and splitting it to 4 6-bit values. The next, we are taking the corresponding symbols from the encoding table (whit contains 64 entries) and writting it to output.

Decoder is more complex, but I think you do not need a decoder.

Encoder results could be tested with any mail program or UUE encoder/decoder which could be found easily via Internet.
0
 
LVL 20

Expert Comment

by:jmcg
ID: 10006630
Nothing has happened on this question in over 10 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by ssnkumar (good help from msa2003, too, but too few points...).

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.
Suggested Courses
Course of the Month14 days, 1 hour left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question