Class JCurl.Response

  • Enclosing class:
    JCurl

    public class JCurl.Response
    extends Object
    • Constructor Detail

      • Response

        public Response()
    • Method Detail

      • print

        public void print()
                   throws CertificateParsingException,
                          IOException
        Print response data and optional meta information. Unless a different configuration is specified with JCurl.Builder, only prints response data. Response is interpreted as application/json by default; this can be changed with -H Content-Type your/mimetype.
        Throws:
        CertificateParsingException
        IOException
      • getResponseCode

        public int getResponseCode()
        Returns:
      • getTimeTaken

        public long getTimeTaken()
        Returns:
      • getCipherSuite

        public String getCipherSuite()
        Returns:
      • getServerCertificates

        public Certificate[] getServerCertificates()
        Returns:
      • getClientCertificates

        public Certificate[] getClientCertificates()
        Returns:
      • getCookie

        public String getCookie​(String name)
        Returns:
      • getOutput

        public String getOutput()
        Returns:
      • getTag

        public String getTag​(String key)
        Parameters:
        key -
        Returns:
      • getTagMap

        public Map<String,​String> getTagMap()
        Return a copy of the map of all tags captured as a result of a call to {@link Builder.extract(String,String)}
        Returns:
        a copy of the map of named tags.
      • getTagList

        public List<String> getTagList()
        Return a copy of the list of all tags captured as a result of a call to {@link Builder.extract(String)}
        Returns:
        a copy of the list of indexed tags.
      • getTag

        public String getTag​(int index)
        Parameters:
        index -
        Returns:
      • getContentType

        public String getContentType()
        Return the content type of the response.
        Returns:
        The MIME type of the response.
      • getJsonNode

        public com.fasterxml.jackson.databind.JsonNode getJsonNode()
                                                            throws IOException
        Return the parsed JSON response, if any.
        Returns:
        A JsonNode representing the response or null.
        Throws:
        IOException