How do I pass custom parameter / callback to httpResponse?

HttpRequest.Callback only accept HttpRequestCallback delegate which looks like
void OnHttpResponse(IHttpResponse response, object userState).


If I want to pass custom parameter or callback with different method signature, what is the best way to do?

Comments

  • hi, @hanjung

    There is at least two options: using lambads or using userState. userState can contain any data you need to handle response including your own callback and parameters

    best,
    ilya
  • @chvetsov Thank you for the answer. Can you give me an example of using lambas please?
  • request.Callback = (response, userState)=>
    {
    //here method you need to call with all parameters and so on
    }

    best,
    ilya