Skip to content

HTTPClient

詳細情報

メンバー

HTTPClient()

constructor

HTTPClient::HTTPClient()

~HTTPClient()

destructor

HTTPClient::~HTTPClient()

begin()

bool HTTPClient::begin(WiFiClient &client, String url)

引数

  • WiFiClient& client &
  • String url String

戻り値

bool success bool

begin()

bool HTTPClient::begin(WiFiClient &client, String host, uint16_t port, String uri="/", bool https=false)

引数

  • WiFiClient& client &
  • String host String
  • uint16_t port uint16_t
  • String uri String
  • bool https bool

戻り値

bool success bool

begin()

bool HTTPClient::begin(String url)

引数

  • String url String

戻り値

bool

begin()

bool HTTPClient::begin(String url, const char *CAcert)

引数

  • String url
  • constchar * CAcert

戻り値

bool

begin()

bool HTTPClient::begin(String host, uint16_t port, String uri="/")

引数

  • String host
  • uint16_t port
  • String uri

戻り値

bool

begin()

bool HTTPClient::begin(String host, uint16_t port, String uri, const char *CAcert)

引数

  • String host
  • uint16_t port
  • String uri
  • constchar * CAcert

戻り値

bool

begin()

bool HTTPClient::begin(String host, uint16_t port, String uri, const char *CAcert, const char *cli_cert, const char *cli_key)

引数

  • String host
  • uint16_t port
  • String uri
  • constchar * CAcert
  • constchar * cli_cert
  • constchar * cli_key

戻り値

bool

end()

end called after the payload is handled

void HTTPClient::end(void)

connected()

connected

bool HTTPClient::connected(void)

戻り値

bool connected status

setReuse()

void HTTPClient::setReuse(bool reuse)

引数

  • bool reuse bool

setUserAgent()

keep-alive

void HTTPClient::setUserAgent(const String &userAgent)

引数

  • constString & userAgent const char *

setAuthorization()

void HTTPClient::setAuthorization(const char *user, const char *password)

引数

  • constchar * user const char *
  • constchar * password const char *

setAuthorization()

void HTTPClient::setAuthorization(const char *auth)

引数

  • constchar * auth const char *

setConnectTimeout()

void HTTPClient::setConnectTimeout(int32_t connectTimeout)

引数

  • int32_t connectTimeout int32_t

setTimeout()

void HTTPClient::setTimeout(uint16_t timeout)

引数

  • uint16_t timeout unsigned int

useHTTP10()

void HTTPClient::useHTTP10(bool usehttp10=true)

引数

  • bool usehttp10

GET()

request handling

send a GET request

int HTTPClient::GET()

戻り値

int http code

PATCH()

int HTTPClient::PATCH(uint8_t *payload, size_t size)

引数

  • uint8_t* payload uint8_t *
  • size_t size size_t

戻り値

int http code

PATCH()

int HTTPClient::PATCH(String payload)

引数

  • String payload

戻り値

int

POST()

int HTTPClient::POST(uint8_t *payload, size_t size)

引数

  • uint8_t* payload uint8_t *
  • size_t size size_t

戻り値

int http code

POST()

int HTTPClient::POST(String payload)

引数

  • String payload

戻り値

int

PUT()

int HTTPClient::PUT(uint8_t *payload, size_t size)

引数

  • uint8_t* payload uint8_t *
  • size_t size size_t

戻り値

int http code

PUT()

int HTTPClient::PUT(String payload)

引数

  • String payload

戻り値

int

sendRequest()

int HTTPClient::sendRequest(const char *type, String payload)

引数

  • constchar * type const char * "GET", "POST", ....
  • String payload String data for the message body

戻り値

int

sendRequest()

int HTTPClient::sendRequest(const char *type, uint8_t *payload=NULL, size_t size=0)

引数

  • constchar * type const char * "GET", "POST", ....
  • uint8_t* payload uint8_t * data for the message body if null not send
  • size_t size size_t size for the message body if 0 not send

戻り値

int -1 if no info or > 0 when Content-Length is set by server

sendRequest()

int HTTPClient::sendRequest(const char *type, Stream *stream, size_t size=0)

引数

  • constchar * type const char * "GET", "POST", ....
  • Stream* stream * data stream for the message body
  • size_t size size_t size for the message body if 0 not Content-Length is send

戻り値

int -1 if no info or > 0 when Content-Length is set by server

addHeader()

void HTTPClient::addHeader(const String &name, const String &value, bool first=false, bool replace=true)

引数

  • constString & name
  • constString & value
  • bool first
  • bool replace

collectHeaders()

Response handling

void HTTPClient::collectHeaders(const char *headerKeys[], const size_t headerKeysCount)

引数

  • constchar * headerKeys
  • constsize_t headerKeysCount
String HTTPClient::header(const char *name)

引数

  • constchar * name

戻り値

String

header()

String HTTPClient::header(size_t i)

引数

  • size_t i

戻り値

String

headerName()

String HTTPClient::headerName(size_t i)

引数

  • size_t i

戻り値

String

headers()

int HTTPClient::headers()

戻り値

int

hasHeader()

bool HTTPClient::hasHeader(const char *name)

引数

  • constchar * name

戻り値

bool

getSize()

size of message body / payload

int HTTPClient::getSize(void)

戻り値

int -1 if no info or > 0 when Content-Length is set by server

getStream()

returns the stream of the tcp connection

WiFiClient & HTTPClient::getStream(void)

戻り値

WiFiClient&

getStreamPtr()

returns a pointer to the stream of the tcp connection

WiFiClient * HTTPClient::getStreamPtr(void)

戻り値

WiFiClient WiFiClient

writeToStream()

int HTTPClient::writeToStream(Stream *stream)

引数

  • Stream* stream *

戻り値

int bytes written ( negative values are error codes )

getString()

return all payload as String (may need lot of ram or trigger out of memory!)

String HTTPClient::getString(void)

戻り値

String String

errorToString()

String HTTPClient::errorToString(int error)

引数

  • int error int

戻り値

String String