Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How to test Async Http Client #321

Open
@timsaunders

Description

@timsaunders

Can someone direct me on how to test the http client, I can't find anything useful on the internet. Example code:

AsyncHttpClient client = new AsyncHttpClient();

client.post("http://www.example.com", someRequestParams, new AsyncHttpResponseHandler()
{
    @Override
    public void onSuccess(String response) {
           System.out.println("Success");        
    }

    @Override
    public void onFailure(Throwable t, String error)
    {
           System.out.println("Failed");
    }
});

I would like to be able to test that it makes it into the response handler and confirm that the callback is being made.

Thanks

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions