×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Aug 2010
    Location
    Chennai, India.
    Posts
    176

    Re-direct URL in HttpConnection.

    Experts,

    I want to connect server to get the data using HttpConnection. I want to connect with one url and it goes to another url and it will get the data.

    For this, I tried like, I will get response code 'HttpConnection.HTTP_MOVED_TEMP'(302). if http response code is equal to 302, then i close the connection and again connected to redirected url but i am not getting the response string.

    What i made wrong..? or is there is any other idea or sample code to do this..?

    kumar

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: Re-direct URL in HttpConnection.

    Hello kumar1234567,

    have you checked whether the following discussion thread provides a solution to your issue?: http://www.developer.nokia.com/Commu...ct-url-in-j2me

    Also, do you know that the response code from the server will be 'HttpConnection.HTTP_MOVED_TEMP'(302)?

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  3. #3
    Regular Contributor
    Join Date
    Aug 2010
    Location
    Chennai, India.
    Posts
    176

    Re: Re-direct URL in HttpConnection.

    Thanks for your reply,

    Quote Originally Posted by r2j7 View Post
    have you checked whether the following discussion thread provides a solution to your issue?: http://www.developer.nokia.com/Commu...ct-url-in-j2me
    I already saw that post, I tried like

    Code:
    httpConn = (HttpsConnection) Connector.open(url);
    httpConn.setRequestMethod(HttpsConnection.POST);
    if(httpConn.getResponseCode() == 302) {
    String location =httpConn.getHeaderField("Location");
    httpConn.close();
    }
    httpConn = (HttpsConnection) Connector.open(location);
    is = hc.openDataInputStream();
    //Get Response from server.
    I'm not getting response from server..?

    Help me,
    kumar

  4. #4
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: Re-direct URL in HttpConnection.

    Does the issue with server response happen with some other response code instead of 302? Like 200 which is used for signalling a successful request?

    How do you handle the response in the omitted code?

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

Similar Threads

  1. Direct link from WAP to MMS?
    By sjsharktank88 in forum General Messaging
    Replies: 0
    Last Post: 2007-09-28, 19:32
  2. PT-3 & HS-1C direct to PC via RS-232 ???
    By tremorpl in forum General Development Questions
    Replies: 1
    Last Post: 2006-04-19, 18:00
  3. Direct X to Symbian.
    By flint87 in forum Symbian
    Replies: 3
    Last Post: 2003-10-12, 08:35
  4. Direct connection?
    By fgasion in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2003-04-01, 17:08
  5. Direct redirection
    By Geartjan in forum Browsing and Mark-ups
    Replies: 1
    Last Post: 2003-02-04, 08:58

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×