(
			self, path: str,
			args: ty.Sequence[str] = [], *,
			opts: ty.Mapping[str, str] = {},
			decoder: ty.Union[ty_Literal_json, ty_Literal_none] = "none",
			stream: bool = False,
			offline: bool = False,
			auth: auth_t = None,
			cookies: cookies_t = None,
			data: reqdata_sync_t = None,
			headers: headers_t = None,
			timeout: timeout_t = None
	)
Sends an HTTP request to the IPFS daemon
		
		This function returns the contents of the HTTP response from the IPFS
		daemon.
		
		Raises
		------
		~ipfshttpclient.exceptions.ErrorResponse
		~ipfshttpclient.exceptions.ConnectionError
		~ipfshttpclient.exceptions.ProtocolError
		~ipfshttpclient.exceptions.StatusError
		~ipfshttpclient.exceptions.TimeoutError
		
		Parameters
		----------
		path
			The command path relative to the given base
		decoder
			The name of the encoder to use to parse the HTTP response
		stream
			Whether to return an iterable yielding the received items incrementally
			instead of receiving and decoding all items up-front before returning
			them
		args
			Positional parameters to be sent along with the HTTP request
		opts
			Query string parameters to be sent along with the HTTP request
		offline
			Whether to request to daemon to handle this request in “offline-mode”
		auth
			Authentication data to send along with this request as
			``(username, password)`` tuple
		cookies
			HTTP cookies to send along with each request to the API daemon
		data
			Iterable yielding data to stream from the client to the daemon
		headers
			Custom HTTP headers to pass send along with the request
		timeout
			How many seconds to wait for the server to send data
			before giving up
			
			Set this to :py:`math.inf` to disable timeouts entirely.
Sends an HTTP request to the IPFS daemon
		
		This function returns the contents of the HTTP response from the IPFS
		daemon.
		
		Raises
		------
		~ipfshttpclient.exceptions.ErrorResponse
		~ipfshttpclient.exceptions.ConnectionError
		~ipfshttpclient.exceptions.ProtocolError
		~ipfshttpclient.exceptions.StatusError
		~ipfshttpclient.exceptions.TimeoutError
		
		Parameters
		----------
		path
			The command path relative to the given base
		decoder
			The name of the encoder to use to parse the HTTP response
		stream
			Whether to return an iterable yielding the received items incrementally
			instead of receiving and decoding all items up-front before returning
			them
		args
			Positional parameters to be sent along with the HTTP request
		opts
			Query string parameters to be sent along with the HTTP request
		offline
			Whether to request to daemon to handle this request in “offline-mode”
		auth
			Authentication data to send along with this request as
			``(username, password)`` tuple
		cookies
			HTTP cookies to send along with each request to the API daemon
		data
			Iterable yielding data to stream from the client to the daemon
		headers
			Custom HTTP headers to pass send along with the request
		timeout
			How many seconds to wait for the server to send data
			before giving up
			
			Set this to :py:`math.inf` to disable timeouts entirely.
Sends an HTTP request to the IPFS daemon This function returns the contents of the HTTP response from the IPFS daemon . Raises ------ ~ipfshttpclient . exceptions . ErrorResponse ~ipfshttpclient . exceptions . ConnectionError ~ipfshttpclient . exceptions . ProtocolError ~ipfshttpclient . exceptions . StatusError ~ipfshttpclient . exceptions . TimeoutError Parameters ---------- path The command path relative to the given base decoder The name of the encoder to use to parse the HTTP response stream Whether to return an iterable yielding the received items incrementally instead of receiving and decoding all items up - front before returning them args Positional parameters to be sent along with the HTTP request opts Query string parameters to be sent along with the HTTP request offline Whether to request to daemon to handle this request in “offline - mode” auth Authentication data to send along with this request as ( username password ) tuple cookies HTTP cookies to send along with each request to the API daemon data Iterable yielding data to stream from the client to the daemon headers Custom HTTP headers to pass send along with the request timeout How many seconds to wait for the server to send data before giving up Set this to : py : math . inf to disable timeouts entirely .
def request(
			self, path: str,
			args: ty.Sequence[str] = [], *,
			opts: ty.Mapping[str, str] = {},
			decoder: ty.Union[ty_Literal_json, ty_Literal_none] = "none",
			stream: bool = False,
			offline: bool = False,
			auth: auth_t = None,
			cookies: cookies_t = None,
			data: reqdata_sync_t = None,
			headers: headers_t = None,
			timeout: timeout_t = None
	) -> ty.Optional[ty.Union[
		StreamDecodeIteratorSync[bytes],
		StreamDecodeIteratorSync[utils.json_dict_t],
		bytes,
		ty.List[utils.json_dict_t],
	]]:
		"""Sends an HTTP request to the IPFS daemon
		
		This function returns the contents of the HTTP response from the IPFS
		daemon.
		
		Raises
		------
		~ipfshttpclient.exceptions.ErrorResponse
		~ipfshttpclient.exceptions.ConnectionError
		~ipfshttpclient.exceptions.ProtocolError
		~ipfshttpclient.exceptions.StatusError
		~ipfshttpclient.exceptions.TimeoutError
		
		Parameters
		----------
		path
			The command path relative to the given base
		decoder
			The name of the encoder to use to parse the HTTP response
		stream
			Whether to return an iterable yielding the received items incrementally
			instead of receiving and decoding all items up-front before returning
			them
		args
			Positional parameters to be sent along with the HTTP request
		opts
			Query string parameters to be sent along with the HTTP request
		offline
			Whether to request to daemon to handle this request in “offline-mode”
		auth
			Authentication data to send along with this request as
			``(username, password)`` tuple
		cookies
			HTTP cookies to send along with each request to the API daemon
		data
			Iterable yielding data to stream from the client to the daemon
		headers
			Custom HTTP headers to pass send along with the request
		timeout
			How many seconds to wait for the server to send data
			before giving up
			
			Set this to :py:`math.inf` to disable timeouts entirely.
		"""
		method = "POST"
		parser = encoding.get_encoding(decoder)
		
		closables, res = self._request(
			method, path, map_args_to_params(args, opts, offline=offline),
			auth=auth, data=data, headers=headers, timeout=timeout,
			chunk_size=None,
		)  # type: ty.Tuple[ty.List[Closable], ty.Generator[bytes, ty.Any, ty.Any]]
		try:
			if stream:
				# Decode each item as it is read
				return StreamDecodeIteratorSync(closables, res, parser)  # type: ignore[misc]
			else:
				# Decode received item immediately
				return stream_decode_full(closables, res,
				                          parser)  # type: ignore[arg-type]
		except:
			# Extra cleanup code for closables
			#
			# At the time of writing, there does not appear to be any way to
			# trigger this loop in practice, but we keep it for as extra level
			# of defence in case things slightly change later-on.
			for closable in closables:  # pragma: no cover
				closable.close()
			
			raise
def request ( self , path : str , args : ty . Sequence [ str ] = [ ] , * , opts : ty . Mapping [ str , str ] = { } , decoder : ty . Union [ ty_Literal_json , ty_Literal_none ] = "none" , stream : bool = False , offline : bool = False , auth : auth_t = None , cookies : cookies_t = None , data : reqdata_sync_t = None , headers : headers_t = None , timeout : timeout_t = None ) -> ty . Optional [ ty . Union [ StreamDecodeIteratorSync [ bytes ] , StreamDecodeIteratorSync [ utils . json_dict_t ] , bytes , ty . List [ utils . json_dict_t ] , ] ] : method = "POST" parser = encoding . get_encoding ( decoder ) closables , res = self . _request ( method , path , map_args_to_params ( args , opts , offline = offline ) , auth = auth , data = data , headers = headers , timeout = timeout , chunk_size = None , ) # type: ty.Tuple[ty.List[Closable], ty.Generator[bytes, ty.Any, ty.Any]] try : if stream : # Decode each item as it is read return StreamDecodeIteratorSync ( closables , res , parser ) # type: ignore[misc] else : # Decode received item immediately return stream_decode_full ( closables , res , parser ) # type: ignore[arg-type] except : # Extra cleanup code for closables # # At the time of writing, there does not appear to be any way to # trigger this loop in practice, but we keep it for as extra level # of defence in case things slightly change later-on. for closable in closables : # pragma: no cover closable . close ( ) raise