Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Associating an outgoing request with its response

Justin Moore Sep 19, 2017 01:21AM UTC


Is there an easy way to associate a request going through the processHttpMessage of a registered IHttpListener with the response that comes back later?


Paul Johnston Sep 19, 2017 08:28AM UTC Support Center agent

Hi Justin,

Thanks for your message. The easiest way at present is to take a hash of the request. Keep a Map within your extension which maps hash(request) to the data you need to track. When a response comes back, you can look call getRequest(), calculate the hash, and fetch the data from the map.

I realize this isn’t ideal. We’ve had a few requests to provide a unique ID on each IHttpRequestResponse. That’s on the development backlog.

Please let us know if you need any further assistance.

Justin Moore Sep 19, 2017 02:21PM UTC
Hey Paul,

Thanks for the fast response. I was planning on going that route but wanted to make sure there wasn't something provided first.


Post Your public answer

Your name
Your email address