×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    Oct 2007
    Posts
    64

    Question about http engine

    Hi,

    I want use Http Engine to get some data from Internet, but http engine is a asynchronous service, I want my function first send URL request, then return after the engine get the data, I try to use User::After to wait data, it not works, I try to use CActive for Http Engine, but it seems can't work, so how could I do this?

    Thank you!!

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Question about http engine

    Yes it does work. Use the HTTP Engine Example
    http://wiki.forum.nokia.com/index.ph...P_with_RSocket

  3. #3
    Regular Contributor
    Join Date
    Mar 2006
    Location
    Bangalore
    Posts
    148

    Re: Question about http engine

    Hi,

    No you dont have to use CActive.
    You can do it by using the RHTTP classes which internally uses CActive.
    Thats the reason you have MHFRunL.
    Could you please post the code snipped, i guess its a mistake with the implementation. I guess that example quoted below is sufficient but be warned it may confuse you.

    Regards,
    Pavan
    Regards,
    Pavan M.V
    ________________________________

    Email: pavan.mysore@symbian.com /pavan.vishu@gmail.com

  4. #4
    Regular Contributor
    Join Date
    Oct 2007
    Posts
    64

    Re: Question about http engine

    Hi,

    Do you have some example for RHttp?

  5. #5
    Regular Contributor
    Join Date
    Oct 2007
    Posts
    64

    Re: Question about http engine

    Hi,
    I have totally no ideal about how to use CActive to do with RHttp

  6. #6
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Question about http engine

    Quote Originally Posted by zhangwei_Nirvana View Post
    Hi,

    Do you have some example for RHttp?
    EPOCROOT\Examples\AppProts\exampleclient

  7. #7
    Regular Contributor
    Join Date
    Oct 2007
    Posts
    64

    Re: Question about http engine

    Hi,

    I change my code according to Examples\AppProts\exampleclient, but my code show System Error(-1), there is my code, (CWebClientEngine is totally same as S60Ex\WebClient) did I do something wrong?


    #define PDD_NAME _L("EUART1")
    #define PDD2_NAME _L("EUART2")
    #define PDD3_NAME _L("EUART3")
    #define PDD4_NAME _L("EUART4")
    #define LDD_NAME _L("ECOMM")

    void InitCommsL()
    {
    TInt ret = User::LoadPhysicalDevice(PDD_NAME);
    User::LeaveIfError(ret == KErrAlreadyExists?KErrNone:ret);
    ret = User::LoadPhysicalDevice(PDD2_NAME);
    ret = User::LoadPhysicalDevice(PDD3_NAME);
    ret = User::LoadPhysicalDevice(PDD4_NAME);
    ret = User::LoadLogicalDevice(LDD_NAME);
    User::LeaveIfError(ret == KErrAlreadyExists?KErrNone:ret);
    ret = StartC32();
    User::LeaveIfError(ret == KErrAlreadyExists?KErrNone:ret);
    }

    class CHttpGetublic MWebClientObserver
    {
    public:
    CWebClientEngine* iClient;
    void GetURL(const TDesC8& aURL, TDes8& aData)
    {
    InitCommsL();
    CActiveScheduler* scheduler = new(ELeave) CActiveScheduler();
    CleanupStack::PushL(scheduler);
    CActiveScheduler::Install(scheduler);
    iClient->IssueHTTPGetL(aURL);
    CActiveScheduler::Start();

    CleanupStack::PopAndDestroy(1);
    }
    .........(ConstructL, NewL...)

    void ClientBodyReceived( const TDesC8& aBodyData )
    {
    CActiveScheduler::Stop();
    }

  8. #8
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    105

    Wink Re: Question about http engine

    http://code.google.com/p/symbian-http-engine/
    there are a project of lib of http request .
    but i don't konw how to use it .
    the code is fine .

  9. #9
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: Question about http engine

    There is now a full HTTP example available at the examples section, so maybe you could try using it. I suppose it was not awailable back in 2007 when this thread was last active.

Similar Threads

  1. Replies: 0
    Last Post: 2006-06-01, 14:30
  2. HTTP Client - Synchronous HTTP POST Calls?
    By symbian_ravi in forum Symbian Networking & Messaging (Closed)
    Replies: 5
    Last Post: 2006-04-16, 11:51
  3. Replies: 2
    Last Post: 2004-01-08, 18:36
  4. series 40 phones(6100,6610) doesn't support http?
    By tangxj in forum Mobile Java General
    Replies: 2
    Last Post: 1970-01-01, 02:00

Posting Permissions

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