By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,649 Members | 696 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,649 IT Pros & Developers. It's quick & easy.

How to view the header that ones client / browser generates?

P: n/a
Hi group,
I'm doing an internetclient via cellphone/gprs that sends a request to html
sites.
The client I've made work great on all sites......except the only site where
I need it :-/

I guess that the problem is that my website host have a firewall, or maybe
just some serversettings, that inhibits my client from getting the site I
request.

What I now need to do is following
Checkking the header that my clientapplication generates, to see how it
differes from headers generated by normal clients, such as inet explorer and
so on.

Are there any site I can request, and see the header I requested with? A
mailback service would be the best, as I receive the response as a
textstream.

Thanks in advance
Adrian
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Adrian Hjelmslund" <Ne**@hjelmslund.dk> wrote in message
news:rb******************@news.get2net.dk...
Hi group,
I'm doing an internetclient via cellphone/gprs that sends a request to html sites.
The client I've made work great on all sites......except the only site where I need it :-/

I guess that the problem is that my website host have a firewall, or maybe
just some serversettings, that inhibits my client from getting the site I
request.

What I now need to do is following
Checkking the header that my clientapplication generates, to see how it
differes from headers generated by normal clients, such as inet explorer and so on.

Are there any site I can request, and see the header I requested with? A
mailback service would be the best, as I receive the response as a
textstream.

Thanks in advance
Adrian


Why not write a simple socket server that will print everything it gets,
byte for byte, to System.out or a file? It takes maybe 30 lines of code.
I've probably got one lying around somewhere.
Jul 17 '05 #2

P: n/a
> Why not write a simple socket server that will print everything it gets,
byte for byte, to System.out or a file? It takes maybe 30 lines of code.
I've probably got one lying around somewhere.


Oh, a misunderstanding here :o)
I'm generating the client request (I have no control over the header I send
though) and I need to see the header of my own request that I send to the
server. I have no access to the server unfortunately :-(
Best regards
Adrian
Jul 17 '05 #3

P: n/a
"Adrian Hjelmslund" <Ne**@hjelmslund.dk> wrote in message
news:tM******************@news.get2net.dk...
Why not write a simple socket server that will print everything it gets,
byte for byte, to System.out or a file? It takes maybe 30 lines of code.
I've probably got one lying around somewhere.
Oh, a misunderstanding here :o)
I'm generating the client request (I have no control over the header I

send though) and I need to see the header of my own request that I send to the
server. I have no access to the server unfortunately :-(
Best regards
Adrian

No, that's what I mean. Write a simple server, and tell your client to
connect to that server, and basically the server will just echo everything
it gets from the client so you can examine it. Something like:

import java.net.*;
import java.io.*;

public class EchoServer {

private int port = 8081;

public EchoServer() {
try {
ServerSocket serverSocket = new ServerSocket(port);
Socket client = serverSocket.accept();
InputStream in = client.getInputStream();
int data;
while ((data = in.read()) != -1) {
System.out.print((char) data);
}
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("---------------- Done");
}

public static void main(String[] args) {
EchoServer es = new EchoServer();
}
}

Understand that I just jotted that down on the spot, no references or
anything, so I can guarantee it will work. It's the general idea though.
Then just run this, and take your client and point it at
http://localhost:8081 (If that port is taken, just change it in the
program.)
Jul 17 '05 #4

P: n/a
Thanks Ryan,
Was just what I needed :-)
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.