Class RequestFactory

java.lang.Object
com.eqixiac.equinix.core.http.request.RequestFactory

public class RequestFactory extends Object
Converts a fully-populated EquinixRequest into the Apache HttpRequestBase that is actually sent on the wire: resolves the URI (endpoint + resource path + encoded query parameters), picks the method-specific Apache request class (including the body-carrying HttpDeleteWithBody when a DELETE has a body), builds the wire entity from the request's RequestBody (serializing JSON payloads, encoding form fields, or attaching raw bytes), and copies the request headers.

This is the single place where a RequestBody becomes a transport entity, and it runs once per dispatch attempt - so a JSON payload mutated between attempts (e.g. a POST-search body whose pagination offset was advanced) is re-serialized automatically.

Author:
ianjones
  • Constructor Details

    • RequestFactory

      public RequestFactory()
  • Method Details

    • create

      public <T> org.apache.http.client.methods.HttpRequestBase create(EquinixRequest<T> request)