Specifying a port in HttpPost

by drill » Sat, 27 Feb 2010 18:36:27 GMT


Sponsored Links
 I want to make a Http-post-request to a webserver on a specific port.
For that I use the HttpPost constructor as follows:
HttpPost post = new HttpPost(" http://webpage.com :1212/httppost.php");
Then I put some parameters with it using
post.setEntity(params);
When I now want to execute that request with
HttpResponse response = client.execute(post);
I receive a NoHttpResponseException.
The server is available and when I try all that without a port I don't
get that exception, but I need to specify my port. Is there anybody
who had a similar problem or do have a solution for me?

Thanks a lot.
regards

--



Other Threads

1. Problem with mediaplayer

Hello, I have a problem with mediaplayer. I have a simple video that
should be played from internet. Sound works, but I can't get the
video...

Code:

        public void onCreate(Bundle icicle) {
                Log.v(TAG,"onCreate");
                super.onCreate(icicle);

                requestWindowFeature(Window.FEATURE_NO_TITLE);

                mPreview = new VideoView(this);

                setContentView(mPreview);
                playVideo();

        }

        private void playVideo() {
                try {
                        Log.v(TAG, "in play video");
                        final String path = 
"http://213.143.65.190/getbkdfile.str?
ch=planet9.sou.sou&fn=a300a37718a8edf5342c465bacb3e811.mp4&showid=a300a37718a8edf5342c465bacb3e811&s=true";
                        Log.v(TAG, "path: " + path);

                        mp = MediaPlayer.create(this, Uri.parse(path));
                        Log.e(TAG, "path set!");

                        mp.setOnErrorListener(this);

                        mp.setDisplay(mPreview.getHolder());
                        setContentView(mPreview);
                        Log.e(TAG, "after setting display");
                        Log.v(TAG, "Duration:  ===>" + mp.getDuration());
                        mp.start();

                } catch (Exception e) {
                        Log.e(TAG, "error: " + e.getMessage(), e);
                        if (mp != null) {
                                mp.stop();
                                mp.release();
                        }
                }
        }

        public boolean onError(MediaPlayer mediaPlayer, int what, int extra)
{
                Log.e(TAG, "onError--->   what:" + what + "    extra:" + extra);
                if (mediaPlayer != null) {
                        mediaPlayer.stop();
                        mediaPlayer.release();
                }
                return true;
        }


Any help would be perfect...

I know I must not be far from the solution.. I think I just don't know
how to put mediaplayer to display...

Thanks in advance,
nejck

-- 

2. Tips to write an app that fetches data from website and displays it on screen

Read up on Sockets and HTTP








> > > 

3. Magic 32A Eclair 2.1 IM3 ga bisa Online gara2 Aktivasi Paket Data Internet.... [reg<spasi>mingguan kirim ke 323], ada Solusi

4. building android for imx51

5. dexopt BUS error , optimization failed

6. HTC Hero handset it not show any decimal point in my application

7. ListView vs. GridView vs. TableLayout