How do I set up a web server to be able to HTTP POST and GET a value from it?

0

I am a total n00b when it comes to networking. I have done some limited networking in Java/Android, though.

Here's what I have done: I have a Raspberry Pi set up as a web server using lighttpd.

Here's the problem: I want to HTTP POST a value (a String or an int or plain text or something) to my home-made web server. Then, I want to be able to, at any time, HTTP GET this value from the server.

How do I accomplish this? What do I need to do on the Raspberry Pi, and what do I need to do in Java (in my Android app that posts and gets the value)?

Eric Cochran

Posted 2013-11-18T21:08:33.743

Reputation: 101

1what you are asking about is a web application, not the webserver itself, and you will have to write an application to take the post, and to retrieve data for your get. perhaps we should look at what you are trying to do rather than this one element of how you might do it. – Frank Thomas – 2013-11-18T21:37:33.737

I am trying to send the number of steps from my step counter app to somewhere so that that number can be retrieved from another device. Are there free web apps that will do this? – Eric Cochran – 2013-11-18T21:53:25.320

You need a webapp for what you described. If you're not looking to learn the basics for that, you could likely enable PUT requests, and just GET what you PUT. You might be better off just setting up an FTP server instead, and uploading/downloading the file as you need. – ernie – 2013-11-18T22:05:06.043

How do I enable PUT requests? – Eric Cochran – 2013-11-18T22:12:45.893

Here's that exact question: Enable Put Command on lightTPD on SO:

– ernie – 2013-11-20T21:40:19.680

No answers