Class NHttpResponse

java.lang.Object
com.netlang.net.NHttpResponse

public class NHttpResponse extends Object
Class that implements a HTTPResponse.
  • Method Details

    • consume

      public void consume()
      Consume content
    • getInternalResponse

      public org.apache.http.HttpResponse getInternalResponse()
    • getStatusCode

      public int getStatusCode()
    • getHeader

      public String getHeader(String name)
    • getHeaders

      public Map<String,String> getHeaders()
    • getContentAsString

      public String getContentAsString() throws org.apache.http.ParseException, IOException
      Throws:
      org.apache.http.ParseException
      IOException
    • getContentUTF8

      public String getContentUTF8() throws org.apache.http.ParseException, IOException
      Throws:
      org.apache.http.ParseException
      IOException
    • getContent

      public String getContent(String encoding) throws org.apache.http.ParseException, IOException
      Throws:
      org.apache.http.ParseException
      IOException
    • getContent

      public byte[] getContent() throws org.apache.http.ParseException, IOException
      Throws:
      org.apache.http.ParseException
      IOException
    • saveContent

      public void saveContent(String file) throws Exception
      Throws:
      Exception
    • saveContent

      public void saveContent(File file) throws Exception
      Throws:
      Exception
    • saveContent

      public void saveContent(NetlangFile file) throws com.net4z.APIException
      Throws:
      com.net4z.APIException
    • saveContent

      public void saveContent(String resourceid, String filepath) throws com.net4z.APIException
      Throws:
      com.net4z.APIException
    • getList

      public <T> List<T> getList(Class<? extends T> responseClass) throws NHttpException
      Throws:
      NHttpException
    • getQuery

      public <T> com.netlang.api.model.QueryResultSet<T> getQuery(Class<? extends T> responseClass) throws NHttpException
      Throws:
      NHttpException
    • getBody

      public <T> T getBody(Class<? extends T> responseClass) throws NHttpException
      Throws:
      NHttpException
    • makeObject

      public <T> T makeObject(NHttpResponse response, Class<? extends T> responseClass) throws Exception
      Throws:
      Exception
    • save

      public void save(com.netlang.session.NetlangSession session, String resourceid, String filepath) throws com.net4z.APIException
      Throws:
      com.net4z.APIException