Package model

Class GlobalpingResponse

java.lang.Object
model.GlobalpingResponse
Direct Known Subclasses:
CreateMeasurementResponse, Limits, MeasurementResponse, Probes

public class GlobalpingResponse extends Object
This class represents a generic response received from a Globalping service.

This class holds HTTP headers received from the request and it's HTTP status code.

  • Constructor Details

    • GlobalpingResponse

      public GlobalpingResponse()
  • Method Details

    • to

      public <T> T to(Class<T> cl) throws IOException
      This method deserializes byte stream into targeted class of given param.

      Example Usage:

      
          GlobalpingResponse res = sendHttpRequest(request);
          return res.to(CreateMeasurementResponse.class);
       
       
      Type Parameters:
      T - the type of the response.
      Parameters:
      cl - the Class object representing the type of response expected.
      Returns:
      an instance of T.
      Throws:
      IOException - if something is wrong with the underlying stream.