Class OkHttpRestfulRequest

java.lang.Object
ca.uhn.fhir.rest.client.api.BaseHttpRequest
ca.uhn.fhir.okhttp.client.OkHttpRestfulRequest
All Implemented Interfaces:
ca.uhn.fhir.rest.client.api.IHttpRequest

public class OkHttpRestfulRequest extends ca.uhn.fhir.rest.client.api.BaseHttpRequest implements ca.uhn.fhir.rest.client.api.IHttpRequest
Adapter for building an OkHttp-specific request.
Author:
Matthew Clarke | matthew.clarke@orionhealth.com | Orion Health
  • Constructor Details

    • OkHttpRestfulRequest

      public OkHttpRestfulRequest(okhttp3.Call.Factory theClient, String theUrl, ca.uhn.fhir.rest.api.RequestTypeEnum theRequestTypeEnum, okhttp3.RequestBody theRequestBody)
  • Method Details

    • getRequest

      public okhttp3.Request.Builder getRequest()
    • addHeader

      public void addHeader(String theName, String theValue)
      Specified by:
      addHeader in interface ca.uhn.fhir.rest.client.api.IHttpRequest
    • execute

      public ca.uhn.fhir.rest.client.api.IHttpResponse execute() throws IOException
      Specified by:
      execute in interface ca.uhn.fhir.rest.client.api.IHttpRequest
      Throws:
      IOException
    • getAllHeaders

      Specified by:
      getAllHeaders in interface ca.uhn.fhir.rest.client.api.IHttpRequest
    • getRequestBodyFromStream

      Specified by:
      getRequestBodyFromStream in interface ca.uhn.fhir.rest.client.api.IHttpRequest
    • getUri

      public String getUri()
      Specified by:
      getUri in interface ca.uhn.fhir.rest.client.api.IHttpRequest
    • setUri

      public void setUri(String theUrl)
      Specified by:
      setUri in interface ca.uhn.fhir.rest.client.api.IHttpRequest
    • getHttpVerbName

      Specified by:
      getHttpVerbName in interface ca.uhn.fhir.rest.client.api.IHttpRequest
    • removeHeaders

      public void removeHeaders(String theHeaderName)
      Specified by:
      removeHeaders in interface ca.uhn.fhir.rest.client.api.IHttpRequest