Jump to content

HTTP request

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
10 replies to this topic

#1
Sinipull

Sinipull

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 386 posts
I need to program my computer to do a single http request every time it starts Windows XP, something like that:

http://www.domain/in...id=1&data=12513

What would be easiest way to do it? I could write a C program and add it to the startup section, but i kinda hope that there's a more simple and "hidden" way to achieve it. The line is always constant and doesn't change, that should make it pretty easy..

#2
sourlemon

sourlemon

    Programmer

  • Members
  • PipPipPip
  • 99 posts
Hm...I'm not I understand what you mean. You want a program that automatically start without you having to add it to start up? Or are you asking if there's a simpler way to write HTTP request?

If it's the first question, I don't know. But it's the second question, I would suggestion Java.
Reading from and Writing to a URLConnection (The Java™ Tutorials > Custom Networking > Working with URLs)

#3
Sinipull

Sinipull

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 386 posts

Quote

You want a program that automatically start without you having to add it to start up?
No, i don't want a program at all if that's possible. Just a little html request to a server.

I know how to write it in Java, but i don't want to use Java in this case, i would like to implement it as simple as possible.
Is it possible to send html request to a server without opening browser as a result?

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
I think the real question in my mind is: to what purpose?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#5
Sinipull

Sinipull

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 386 posts
The server is collecting information about computer's IP address.

#6
MeTh0Dz

MeTh0Dz

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,119 posts
So you want to make a HTTP request without software. That makes no sense.

#7
Sinipull

Sinipull

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 386 posts
I was hoping XP could handle that with some previously built function.

#8
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
I believe you will find all the necessary functions in winsock.h

#9
Sinipull

Sinipull

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 386 posts
Wow, i never imagined it will be such a headache to find any information about C from google.
Several hours of searching, nothing useful, found some code, but it didn't work on my dev-c++.
Any examples of using winsock? Searched the tutorial section, didn't see anything useful about sockets in there.

Edit: never mind, i decided to use Java after all, Took 3 lines of code.

Edited by Sinipull, 13 April 2010 - 06:08 AM.


#10
mrhbrandi

mrhbrandi

    Newbie

  • Members
  • PipPip
  • 17 posts
Hi,

Please provide me the JAVA code to test the same.

#11
Sinipull

Sinipull

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 386 posts
URL url = new URL("http://www.domain.com/etc");
InputStream is = url.openStream();
is.close();