Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
Posts: 15
Registered: ‎07-15-2013
My Device: Blackberry Z10
My Carrier: Verizon

How to correspond incoming http replies to their previous http request counterparts?

Hello,

 

First off, I would like to say I'm totally new to BB and I'm coming from an Android background.

 

I've been looking at samples such as:

 

https://developer.blackberry.com/cascades/documentation/device_comm/networking/

 

I have an application which is making a lot of different (and similar) web requests. How do I identify these incoming replies so I can demux them to their appropriate components? Can I tag them somehow?

 

Thanks and please let me know if I can be more clear.

Highlighted
Retired
Posts: 1,561
Registered: ‎04-12-2010
My Device: BlackBerry Z10
My Carrier: Bell

Re: How to correspond incoming http replies to their previous http request counterparts?

Hi there; assuming you are referring to Ajax requests to a web service (i.e. XMLHttpRequest or other similar APIs), then a session is created when you initiate the request between the client and server.

For instance, if you make 3 requests (i.e. 3 connections):
1) Request for First Name.
2) Request for Middle Name.
3) Request for Last Name.

And let's say our person is George Allan Bob.

Then even if request 3 returns first, connection 3 will be what receives Bob.

And connection 1 will receive Goerge, and connection 2 will receive Allan.

Basically, when you make a request, that sessions stays active between the client/server, and a response will be returned to the same connection that initiated the request.

Let me know if that isn't clear :-)

Erik Oros | @WaterlooErik | eoros@blackberry.com | Developer Issue Tracker

If a reply has answered your question, please click Accept as Solution to help other visitors in the future.