Alex Rivera | Logout

How to use HttpClient with multithreaded operation?

Asked 2011-03-28T07:00:59.683
10

I've to do an application that performs a Login POST request in a certain host, then navigates some pages, finds and retrieves some data. Becase the website resouce is protected by session, so I have to login the website first before I can do some operation such as get or post some data. My question is because HttpClient is not thread-safe, how can I create only one HttpClient instance but threads can perform on it safely? Remember that the underlying connection must login first before it can be used to operate.

Edit
Report

1 Answer

3
answered 2011-03-28T07:03:02.943

Your Answer