scheduler http tests

This commit is contained in:
proddy
2024-07-20 13:22:01 +02:00
parent 353e1f4460
commit 809c5c7ead
4 changed files with 65 additions and 6 deletions

View 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_ */

View File

@@ -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

View File

@@ -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;
};