本文整理汇总了C++中WiFly::print方法的典型用法代码示例。如果您正苦于以下问题:C++ WiFly::print方法的具体用法?C++ WiFly::print怎么用?C++ WiFly::print使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WiFly
的用法示例。
在下文中一共展示了WiFly::print方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _headerStart
void JSONAPI::_headerStart (const char *method) {
// If an old connection is active, close.
if (wifly.isConnected()) {
wifly.close();
}
if (!wifly.open(this->host, 80)) {
Serial.println(F("Failed to connect to host."));
}
wifly.print(method);
wifly.print(" ");
// wifly.print("http://");
// wifly.print(this->host);
}
示例2: _headerEnd
void JSONAPI::_headerEnd () {
wifly.println(" HTTP/1.1"); // paste your number here
wifly.print("Host: ");
wifly.println(this->host);
wifly.println("User-Agent: lifegraph/0.0.1");
if (this->hasBody) {
wifly.println("Content-Type: application/x-www-form-urlencoded");
wifly.println("Transfer-Encoding: chunked");
}
wifly.println();
}
示例3: connect
int LifegraphAPI::connect (uint8_t uid[], int uidLength) {
this->hasBody = false;
this->_headerStart("GET");
this->_headerPath("tokens");
wifly.print("/");
char token[3];
for (int i = 0; i < uidLength; i++) {
snprintf(token, 3, "%02x", uid[i]);
wifly.print(token);
}
wifly.print("?namespace=");
wifly.print(this->ns);
wifly.print("&key=");
wifly.print(this->key);
wifly.print("&secret=");
wifly.print(this->secret);
this->_headerEnd();
return this->request( NULL );
}
示例4: _headerPath
void FacebookAPI::_headerPath (const char *path, const char *access_token) {
wifly.print(this->base);
wifly.print("/");
wifly.print(path);
if (access_token != 0) {
wifly.print(strstr(path, "?") == 0 ? "?" : "&");
wifly.print("access_token=");
wifly.print(access_token);
}
wifly.print(strstr(path, "?") == 0 ? "?" : "&");
wifly.print("namespace=");
wifly.print(Lifegraph.ns);
wifly.print("&key=");
wifly.print(Lifegraph.key);
wifly.print("&secret=");
wifly.print(Lifegraph.secret);
}