×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    30

    Accessing the data in a HTTP filter

    Hi,

    I wanted to access the body of a HTTP request and I see in the documentation that an filter provides an handle to MHTTPDataSupplier class through which the data of a request can be retrieved, but I am not aware as to how I can access this data supplier to retrieve the information of this data supplier.If i try to use the following code, it gives a EUser CBase 42 panic, which says that there is already an active object running(meaning there is a data supplier already present)

    iDataSupplier = aTransaction.Request().Body();
    iDataSupplier->GetNextDataPart(Ptr);

    Can anyone please let me know how to access the datasupplier provided by the filter.

  2. #2
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Accessing the data in a HTTP filter

    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    30

    Re: Accessing the data in a HTTP filter

    Hi,

    I tried to access the body of a HTTP request, i.e the data being posted during a file upload as i have to start an application depending on the content type of the multipart data being uploaded, I am trying to omplement this funcationality in a filter but i am getting a panic unable to perform the opeartion -26000.

    I am using getnextdatapart of the MHTTPDataSupplier class in the submit event of the filter, actually it is blocking the whole uploading event.

    Here is the chunk of code :

    case THTTPEvent::ESubmit:
    {

    RHTTPRequest aRequest;
    MHTTPDataSupplier* iDataSupplier;


    TBool HasBody = aTransaction.Request().HasBody();
    if(HasBody==1)
    {

    iDataSupplier = aTransaction.Request().Body();
    TPtrC8 ptr;
    TBool isLast = iDataSupplier->GetNextDataPart(ptr);
    if(isLast==EFalse)
    {
    iDataSupplier->ReleaseData();
    }

    Display();
    }

    }
    break;

    Kindly let me know how do we get to know the content type of the data being uploaded through a filter.

    Regards.

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

    Re: Accessing the data in a HTTP filter

    at least if(HasBody==1) is not gonna be true too often, since ETrue != EFalse, and EFalse != 0, which means that ETrue can be any other value than 0 actually.

  5. #5
    Registered User
    Join Date
    Mar 2008
    Posts
    30

    Re: Accessing the data in a HTTP filter

    Hi SymbianYucca,

    Actually all submit events do not have body to check this condition I am using this but the line iDataSupplier->GetNextDataPart(ptr) is giving problem, can u please let me know what might be causing problem.

    Looking forward for suggestion on the same.

    Regards!

Similar Threads

  1. encoding when fetching data with HTTP Service
    By j-engineering in forum Widsets Development
    Replies: 1
    Last Post: 2008-08-19, 16:10
  2. encypting data to be sent using HTTP (MIDP 1.0)
    By dihex in forum Mobile Java Networking & Messaging & Security
    Replies: 7
    Last Post: 2005-10-27, 20:16
  3. Http send and receive data
    By white_dragon in forum Symbian
    Replies: 1
    Last Post: 2005-02-02, 10:01
  4. get the response body data - Http
    By white_dragon in forum Symbian
    Replies: 8
    Last Post: 2004-11-25, 11:27

Posting Permissions

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