×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jun 2010
    Posts
    7

    simulate http request

    hi,


    I have a widget running in nokia s60 emulator.. that widget will send http request to the servlet..my question is how to simulate http request in s60 emulator, are there any configuration needed to be able to send http request to my servlet which is in this url http://localhost:8080/GPS/getgps...how i can i found out if the widget running to emulator is sending request to my servlet..do i need to integrate my ide to the emulator?

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: simulate http request

    Hi yynneejj,

    S60 emulator should be already enabled to perform HTTP requests, without any additional tweaks.

    To check if your requests correctly start, you could use the emulator Diagnostics panel ("Tools" -> "Diagnostics").

    Hope it helps,
    Pit

  3. #3
    Registered User
    Join Date
    Jun 2010
    Posts
    7

    Re: simulate http request

    hi jappit,

    when i tried that diagnostic tool and runmy widget,,no record added to the diagnostic tool..does it mean i don't make http post request successfully?

    here is my code in sending http request,,

    function send(){
    var updateoptions = new Object();
    updateoptions.PartialUpdates = false;
    var criteria = new Object();
    criteria.LocationInformationClass = "BasicLocationInformation";
    criteria.Updateoptions = updateoptions;

    try {
    so.ILocation.GetLocation(criteria,callback2);

    }
    catch (e) {

    alert ("getLocation: " + e);
    }

    }
    function callback2(transId, eventCode, result){
    var longitude = result.ReturnValue.Longitude;
    var latitude = result.ReturnValue.Latitude;


    var req = null;
    try {
    req = new XMLHttpRequest();


    req.onreadystatechange = function() {
    if (req.readyState == 4) {
    if (req.status == 200) {
    }
    } else {
    alert("Error");
    }
    }

    req.open("POST","http://localhost:8080/GPS/getgps",true);
    req.setRequestHeader("longitude",+longitude);
    req.setRequestHeader("latitude",+latitude);

    req.send();
    } catch (e) {
    alert(e);
    }
    }

    do i need some additionally in my code..what is it and how..thanks

Similar Threads

  1. Http filter to modify out going http request .
    By redzvika in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2010-05-02, 14:49
  2. How to simulate touch event (to simulate beep and haptics)
    By XclusR in forum Symbian User Interface
    Replies: 5
    Last Post: 2009-02-08, 14:01
  3. HTTP request
    By sammu_ece in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2008-06-24, 14:35
  4. HTTP Request
    By donutface in forum Symbian
    Replies: 4
    Last Post: 2008-03-31, 20:02

Posting Permissions

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