def default_faraday_block
      lambda do |connection|
        connection.use Faraday::Response::RaiseError
        connection.use FaradayMiddleware::FollowRedirects
        connection.request :hal_json
        connection.response :hal_json, content_type: /\bjson$/
        connection.adapter :net_http
        connection.options.params_encoder = Faraday::FlatParamsEncoder
      end
    end
def default_faraday_block
      lambda do |connection|
        connection.use Faraday::Response::RaiseError
        connection.use FaradayMiddleware::FollowRedirects
        connection.request :hal_json
        connection.response :hal_json, content_type: /\bjson$/
        connection.adapter :net_http
        connection.options.params_encoder = Faraday::FlatParamsEncoder
      end
    end
Internal: Returns a block to initialize the Faraday connection. The
 default block includes a middleware to encode requests as JSON, a
 response middleware to parse JSON responses and sets the adapter as
 NetHttp.

 These middleware can always be changed by accessing the Faraday
 connection.

 Returns a block.