Kong/unirest-net

Connection timeout

Opened this issue · 0 comments

Is there any easy way to set the connection timeout? Something like this:

HttpResponse<MyClass> jsonResponse = Unirest.post("http://httpbin.org/post")
  .setTimeout(3000)
  .header("accept", "application/json")
  .field("parameter", "value")
  .field("foo", "bar")
  .asJson<MyClass>();

or I need to do it in HttpRequest?

HttpRequest request = Unirest.post(String url);

An example would be helpful. Thanks.