Pass a callback function to webclient request

It would be really helpful if I could pass a callback function inside the request to the Webclient DAT.

It would enable me to execute another function based on the received data, when handling multiple requests.

The Web Client DAT has an onResponse callback that essentially serves this purpose already.

You mean it can handle this format?

    client.request(
        url, 
        method,
        header=headers,    
        data=dataJ,
        callback=on_response  # Pass the callback function
    )

I am sorry then.

Maybe I did not do an excessive test.

I had an issue with handling multiple requests from a single client dat recently.
I needed to “Create a room”, and then “Get the Room Data”… and needed to execute specific functions related to each of these requests.

I ended up implementing a response map dictionary to connect the id’s to a handler function.

I am not really skilled in programing and it was a bit tricky for me.
The format mentioned above seemed more easy to understand for me, as I already nest the function I need inside the request.