×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 22

Hybrid View

  1. #1
    Registered User
    Join Date
    Sep 2012
    Posts
    20

    what is header file required for HTTP::EuserAgent?

    what is header file required for HTTP::EuserAgent?

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

    Re: what is header file required for HTTP::EuserAgent?

    You could maybe check the docs: http://library.developer.nokia.com/i...7C7752639.html there is attached example applciation which is using this class as well, so you could see what headers are included in there.

    Or search the include folder in your SDK.

  3. #3
    Registered User
    Join Date
    Sep 2012
    Posts
    20

    Re: what is header file required for HTTP::EuserAgent?

    yse I got it in a link below this post. <http.h>
    I have a series of other issues.
    i have a function
    void ChelloHTTPEngine::InvokeHttpMethodL(const TDesC8& aUri, RStringF aMethod);
    what is the value with which i should call this function
    TRAPD(err, iHTTPEngine->InvokeHttpMethodL(aUri, HTTP::EGET));--> does not accept
    My project is yet to begin, I am developing prototype.. So, can I get address of some server so that I can test my HTTP Code.
    Last edited by abhinavnishantintg; 2012-10-05 at 08:08.

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

    Re: what is header file required for HTTP::EuserAgent?

    I would suggest you do check the full exanmple for HTTP available at the examples section: https://www.developer.nokia.com/Deve...tworking.xhtml in general its easier to check exiting and working code. Just see how its done there, and copy-paste the code segment..

  5. #5
    Registered User
    Join Date
    Sep 2012
    Posts
    20

    Re: what is header file required for HTTP::EuserAgent?

    everytime I build it, it gets stuck

  6. #6
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,957

    Re: what is header file required for HTTP::EuserAgent?

    is this the case with every SDK you build for?

  7. #7
    Registered User
    Join Date
    Sep 2012
    Posts
    20

    Re: what is header file required for HTTP::EuserAgent?

    I am using S60_3rd_FP2_SDK_v1.1.....My colleague is using the same.. we both get the same.

    Also I tried to get a new class. copy paste the whole code from the example. Still , the controll goes to default and not to EGotResponseHeaders: and EGotResponseBodyData:. I had made an error in url. I changed it. now it is crashing. let me check further.
    Last edited by abhinavnishantintg; 2012-10-08 at 12:25.

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

    Re: what is header file required for HTTP::EuserAgent?

    Can you explain in details on what you are doing (step-by-step) before it gets stuck ?

    It sounded on some point that you got stuck while building, and now it sounds that its getting stuck on some point when executing the code.. so its not really clear on what is happening.

    Also can you explain what you mean with stuck ?
    - is the IDE un-responsive, or just some part of it ?

  9. #9
    Registered User
    Join Date
    Sep 2012
    Posts
    20

    Re: what is header file required for HTTP::EuserAgent?

    I think , the code that i prepared is working fine. thanks..

    while building the imported example code, the build does not go to completion. it goes to 1/3 rd of it and stys there for all time.

    I do right click on carbide and select import.
    then select Symbian OS bld.inf from window that appears.
    then next and go to the folder where bld.inf is there and select it
    now project is imported to my workspace.
    I buid it.
    that is all I do.
    it gets stuck after build progress bar shows 1/3rd of the whole..
    Last edited by abhinavnishantintg; 2012-10-08 at 13:13.

  10. #10
    Registered User
    Join Date
    Sep 2012
    Posts
    20

    Re: what is header file required for HTTP::EuserAgent?

    yes I have this code, and I have read the SDK, I have developed the code.
    pasting below->
    appui-> handle commandl--------
    _LIT(KAddress,"https://www.google.co.in/#hl=en&sugexp=les%3B&gs_nf=1&tok=wmCW2k6BCJLQ_tLRmmiTEA&cp=3&gs_id=1i0&xhr=t&q=wikipedia&pf=p&output=search&sclient=psy-ab&oq=wik&gs_l=&pbx=1&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.&fp=7830c53aba414a9f&biw=1366&bih=665");
    TBuf8<20>aUri;
    TRAPD(err, iHTTPEngine->InvokeHttpMethod(aUri,EGet ));
    ----------------------------------------------------------------------------------------------------------------------------------------------------
    class ChelloHTTPEngine : public CBase,MHTTPTransactionCallback
    {
    .............
    void MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent &aEvent);
    TInt MHFRunError(TInt aError, RHTTPTransaction aTransaction, const THTTPEvent &aEvent);
    void InvokeHttpMethodL(const TDesC8& aUri, RStringF aMethod);
    void SetHeaderL(RHTTPHeaders aHeaders, TInt aHdrField, const TDesC8& aHdrValue);
    RHTTPSession iSession;
    };
    ----------------------------------------------------------------------------------------------------------------------------------------------------------

    void ChelloHTTPEngine::ConstructL()
    {
    iSession.OpenL();

    }

    void ChelloHTTPEngine::MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent &aEvent)
    {
    switch (aEvent.iStatus)
    {
    case THTTPEvent::EGotResponseHeaders:
    {

    }
    break;
    case THTTPEvent::EGotResponseBodyData:
    {

    }
    break;
    case THTTPEvent::EResponseComplete:
    {

    }
    break;
    case THTTPEvent::ESucceeded:
    {

    }
    break;
    case THTTPEvent::EFailed:
    {

    }
    break;
    default:
    {

    }
    break;
    }

    }

    void ChelloHTTPEngine::InvokeHttpMethod(const TDesC8& aUri, TMethod aMethod)
    {
    if(aMethod==EGet)
    InvokeHttpMethodL(aUri,iSession.StringPool().StringF(HTTP::EGET,RHTTPSession::GetTable())) ;
    if(aMethod==EPost)
    InvokeHttpMethodL(aUri,iSession.StringPool().StringF(HTTP::EPOST,RHTTPSession::GetTable())) ;

    }

    void ChelloHTTPEngine::InvokeHttpMethodL(const TDesC8& aUri, RStringF aMethod)
    {
    //const TDesC8& aUri;

    TUriParser8 uri;
    uri.Parse(aUri);
    RHTTPTransaction trans = iSession.OpenTransactionL(uri, *this, aMethod);
    RHTTPHeaders hdr = trans.Request().GetHeaderCollection();
    // Add headers appropriate to all methods
    SetHeaderL(hdr, HTTP::EUserAgent, KUserAgent);
    SetHeaderL(hdr, HTTP::EAccept, KAccept);
    // submit the transaction
    trans.SubmitL();
    // Start the scheduler, once the transaction completes or is cancelled on an error the scheduler will be
    // stopped in the event handler
    CActiveScheduler::Start();

    };
    TInt ChelloHTTPEngine::MHFRunError(TInt aError, RHTTPTransaction aTransaction, const THTTPEvent &aEvent)
    {

    }
    void ChelloHTTPEngine::SetHeaderL(RHTTPHeaders aHeaders, TInt aHdrField, const TDesC8& aHdrValue)
    {
    RStringF valStr = iSession.StringPool().OpenFStringL(aHdrValue);
    THTTPHdrVal val(valStr);
    aHeaders.SetFieldL(iSession.StringPool().StringF(aHdrField,RHTTPSession::GetTable()), val);
    valStr.Close();
    }


    I have just one compilation error-------------
    have a function
    void ChelloHTTPEngine::InvokeHttpMethodL(const TDesC8& aUri, RStringF aMethod);
    what is the value with which i should call this function
    TRAPD(err, iHTTPEngine->InvokeHttpMethodL(aUri, HTTP::EGET));--> does not accept


    Rest of the code.....does it look ok..
    Last edited by abhinavnishantintg; 2012-10-05 at 13:42.

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

    Re: what is header file required for HTTP::EuserAgent?

    Quote Originally Posted by abhinavnishantintg View Post
    ...
    TRAPD(err, iHTTPEngine->InvokeHttpMethodL(aUri, HTTP::EGET));--> does not accept
    ...
    Are you sure its written like that in the example ?
    Also you might want to share more information , like what kind of error it generates and when.. Anyway, please do check the example and see how its handled in there first.

  12. #12
    Registered User
    Join Date
    Sep 2012
    Posts
    20

    Re: what is header file required for HTTP::EuserAgent?

    may be i should use
    iSession.StringPool().StringF(HTTP::EGET,RHTTPSession::GetTable())
    instead of (HTTP::EGET)
    as I am using the function from appui where there is no RHTTPSession, I may take help of enums.
    let me take a try...

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

    Re: what is header file required for HTTP::EuserAgent?

    please, I don't want to repeat myself, but as the example has perfectly working code snipped included in it, I do suggest you to copy-paste it from there. If you would have done this when I asked first time, we would have been over this issue already, so what about trying what has been suggested.

  14. #14
    Registered User
    Join Date
    Sep 2012
    Posts
    20

    Re: what is header file required for HTTP::EuserAgent?

    hi,
    I am trying to run the code,
    (I have included the google url )
    but in mhfrunl()
    THTTPEvent::EGotResponseBodyData: and THTTPEvent::EGotResponseHeaders: are not getting executed
    instead
    control goes to default: and THTTPEvent::EFailed:


    then i tried changing code

    void ChelloHTTPEngine::InvokeHttpMethodL(const TDesC8& aUri, RStringF aMethod)
    {
    //const TDesC8& aUri;
    User::LeaveIfError(iSocketServ.Connect());
    User::LeaveIfError(iConnection.Open(iSocketServ));
    iConnection.Start(/*iStatus*/);
    TUriParser8 uri;
    uri.Parse(aUri);
    RHTTPTransaction trans = iSession.OpenTransactionL(uri, *this, aMethod);
    RHTTPHeaders hdr = trans.Request().GetHeaderCollection();
    // Add headers appropriate to all methods
    SetHeaderL(hdr, HTTP::EUserAgent, KUserAgent);
    SetHeaderL(hdr, HTTP::EAccept, KAccept);
    // submit the transaction
    trans.SubmitL();
    // Start the scheduler, once the transaction completes or is cancelled on an error the scheduler will be
    // stopped in the event handler
    CActiveScheduler::Start();

    };
    still result is the same

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

    Re: what is header file required for HTTP::EuserAgent?

    I'm rather sure that the original example has pretty different coding, so please do check it. At least I can not remember it having nested Active schedulers etc.

Similar Threads

  1. [help]#error "The header file 'http.h' doesn't include <QObject>,for help me....
    By yangkaiye in forum [Archived] Qt General ( Qt技术)
    Replies: 0
    Last Post: 2010-12-23, 02:42
  2. Replies: 0
    Last Post: 2010-08-23, 05:02
  3. header files required
    By mobileteam in forum Symbian Tools & SDKs
    Replies: 3
    Last Post: 2007-08-08, 06:48
  4. Header files required?
    By sreenivasuluy in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2003-10-14, 14:46
  5. HTTP header and WAP209 header equivalence/precedence/conf licts
    By mobilecohesion in forum General Messaging
    Replies: 0
    Last Post: 2002-12-03, 11:49

Posting Permissions

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