Hello, I have just decided to migrate my project from API 4.0 to 4.2. There is a lot of new stuff, so I am not sure what's the best way to (re)implement the following logic. Can you enlighten me, please? Thank you!
Short story: I need to a) assign some initial values for HTTP requests, b) process the HTTP responses with respective callbacks, and c) cancel a request when it produces a long response data stream. Current (4.0 API) implementation: The application uses NHttpClientHandler as a wrapper for NHttpRequestExecutionHandler. This execution handler (exec-handler) assigns some starting values, e.g. user-agent and target-host, according to an attachment object in initalizeContext(). The handler also constructs a special entity (see responseEntity method) that throws an exception when the data stream is too long. The exception is caught and handled in an event listener (see EventListener interface) registered in the client-handler (see setEventListener). Finally, the body of the response is processed (see exec-handler's handleResponse method) by a callback stored in the context object. LG BTW: Obviously, I can share the source code. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
