HttpClient
class HttpClient (View source)
Methods
void
__construct(string|null $base_url = null)
HttpClient Constructor.
void
setBaseUrl(string $url)
Set the base url
addAttach(string|array $attach)
Attach new file
addHeaders(array $headers)
Add aditionnal header
setUserAgent(string $user_agent)
Set the user agent
acceptJson()
Set the json accept prop to format the sent content in json
Details
void
__construct(string|null $base_url = null)
HttpClient Constructor.
void
setBaseUrl(string $url)
Set the base url
Response
get(string $url, array $data = [])
Make get requete
Response
post(string $url, array $data = [])
make post requete
Response
put(string $url, array $data = [])
Make put requete
Response
delete(string $url, array $data = [])
Make put requete
HttpClient
addAttach(string|array $attach)
Attach new file
HttpClient
addHeaders(array $headers)
Add aditionnal header
HttpClient
setUserAgent(string $user_agent)
Set the user agent
HttpClient
acceptJson()
Set the json accept prop to format the sent content in json