T
Tessy Katsiampa
hello all,
I used HttpUrlConnection & AsyncTask classes in Android to perform an HTTP GET and POST request in order to upload and download an image to/from a server correspondingly. I must write a Ruby script on server side to handle these requests. I managed to authenticate the user but i don't know how to store and send the image on/from the server to the Android application and also how to create a folder containing all the user data (images) on server side. Could anyone please help me with that part? I have attached the code in Ruby that i managed to write:
require 'rubygems'
require 'sinatra'
use Rack::Auth::Basic, "Restricted Area" do |username,password|
username=='user' and password=='user1'
end
get '/' do
end
post '/' do
end
ps:the only thing that my script needs to do is to store the image from theHTTP POST request,that the android application will perform and then to send this image back to the android application when the user performs a HTTPGET request
Thanks in advance!
I used HttpUrlConnection & AsyncTask classes in Android to perform an HTTP GET and POST request in order to upload and download an image to/from a server correspondingly. I must write a Ruby script on server side to handle these requests. I managed to authenticate the user but i don't know how to store and send the image on/from the server to the Android application and also how to create a folder containing all the user data (images) on server side. Could anyone please help me with that part? I have attached the code in Ruby that i managed to write:
require 'rubygems'
require 'sinatra'
use Rack::Auth::Basic, "Restricted Area" do |username,password|
username=='user' and password=='user1'
end
get '/' do
end
post '/' do
end
ps:the only thing that my script needs to do is to store the image from theHTTP POST request,that the android application will perform and then to send this image back to the android application when the user performs a HTTPGET request
Thanks in advance!