473,385 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Sending only HTTP header information to clients

Hi,

We have an aspx page designed in VS.NET 2003. Our requirement is that a client (another application), sends HEAD requests to our application with Basic Auth header. Based on security criteria, we need to "tell" the other application whether the user is allowed to use that page or not. Another criteria is that if a specific user comes to this page then the entire content of that page should be displayed to him / her.

The calling application understands standard HTTP protocols. We just need to tailor our application to suit the same.

The query is what headers should be sent to the calling application to signify that a user can access a page, alternatively what headers should be sent to the calling application to signify that a user CANNOT access a page?

I think we have to send HTTP Status code as 200 for allowing access and HTTP Status code 401.2 to deny access. The issue is how to send just the headers from ASP.NET? Is it ok if we just do
Response.clearContent(),
set the appropriate status code and
then say response.end()?

From my reading, I have found that when a HEAD request comes to an application, the application should respond with header information only and no body content should be sent. How to do this in ASP.NET page which is supposed to do both, i.e. display data in certain conditions and send only header info in case of head requests????

Please let me know if the status codes that I am trying to use are ok or not.me know.

Thanks in advance.
Nov 18 '05 #1
1 2216
Dhwanil Shah wrote:
Hi,

We have an aspx page designed in VS.NET 2003. Our requirement is that
a client (another application), sends HEAD requests to our
application with Basic Auth header. Based on security criteria, we
need to "tell" the other application whether the user is allowed to
use that page or not. Another criteria is that if a specific user
comes to this page then the entire content of that page should be
displayed to him / her.

The calling application understands standard HTTP protocols. We just
need to tailor our application to suit the same.

The query is what headers should be sent to the calling application
to signify that a user can access a page, alternatively what headers
should be sent to the calling application to signify that a user
CANNOT access a page?

I think we have to send HTTP Status code as 200 for allowing access
and HTTP Status code 401.2 to deny access. The issue is how to send
just the headers from ASP.NET? Is it ok if we just do
Response.clearContent(),
set the appropriate status code and
then say response.end()?

From my reading, I have found that when a HEAD request comes to an
application, the application should respond with header information
only and no body content should be sent. How to do this in ASP.NET
page which is supposed to do both, i.e. display data in certain
conditions and send only header info in case of head requests????

Please let me know if the status codes that I am trying to use are ok
or not.me know.


I don't think you need to do anything. HEAD requests are handled by IIS.
Thus, if you're ASP.NET page works for GET/POST requests, it should work for
HEAD requests as well.

Cheers,
--
Joerg Jooss
jo*********@gmx.net

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Glenn Wilson | last post by:
I am writing a network system for project I am working on. How would I send a class or structure to the clients and recieve one back. Or how would I go about building a packet with a header and...
4
by: TomHL | last post by:
Hello, I want to send an additional info with byte array wiith sockets as "one packet". I know how to send the byte array by himself, but how can I send the additional info with it at the same...
2
by: Glenn via .NET 247 | last post by:
Hi, I am using System.Web.Mail.SmtpMail.Send to send mail through vbcode. It works good within our network, but out clientsfirewall filters out the emails that come from our application. I...
0
by: Navin Mishra | last post by:
Hi, I've a service that connects to the clients via TCP and sends data on client's opened TCP port. The data is in XML and I use ASCII encoding. There is 8 byte of header containing length of...
6
by: Anuradha | last post by:
Dear All How can i send mails using vb.net Thanx all
12
by: Aggelos | last post by:
Hello everyone, I am trying to emulate sort of a Payment Gateway. A user makes an order and then when he checks out he gets transfered to the HTTPS page to enter his details. At the moment I am...
3
by: shybe | last post by:
I have a send mail script on my site that. The emails are recieved by gmail, and yahoo, but not to mail clients like Outlook, Mail, etc...) Is this a problem with the script, or is it...
10
by: Markgoldin | last post by:
I am sending an XML data from not dontnet process to a .Net via socket listener. Here is a data sample: <VFPData> <serverdata> <coderun>updateFloor</coderun> <area>MD2</area>...
8
by: nargis2009 | last post by:
Hi, I have been encountering problems with my web page which is supposed to send email, and wondered if anybody can help find error. Initially I had all codes in one page and on click of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.