mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
scheduler http tests
This commit is contained in:
27
lib_standalone/HTTPClient.h
Normal file
27
lib_standalone/HTTPClient.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef HTTPClient_H_
|
||||
#define HTTPClient_H_
|
||||
|
||||
#include "WString.h"
|
||||
|
||||
class HTTPClient {
|
||||
public:
|
||||
// HTTPClient();
|
||||
// ~HTTPClient();
|
||||
|
||||
bool begin(String url) {
|
||||
return true;
|
||||
};
|
||||
void end(void) {};
|
||||
int GET() {
|
||||
return 200;
|
||||
};
|
||||
int POST(String payload) {
|
||||
return 200;
|
||||
};
|
||||
void addHeader(const String & name, const String & value, bool first = false, bool replace = true) {};
|
||||
String getString(void) {
|
||||
return "Hello, World!";
|
||||
};
|
||||
};
|
||||
|
||||
#endif /* HTTPClient_H_ */
|
||||
@@ -69,4 +69,4 @@ size_t strlcat(char * dst, const char * src, size_t siz) {
|
||||
return (dlen + (s - src)); /* count does not include NUL */
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -53,6 +53,14 @@ class String {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int len() const {
|
||||
return _str.size();
|
||||
}
|
||||
|
||||
bool startsWith(const char * prefix) const {
|
||||
return _str.find(prefix) == 0;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string _str;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user