HTTP and HTTPS library for Mbed OS 5
Dependents: RZ_A2M_Mbed_samples_20201012 RZ_A2M_Mbed_samples
Diff: source/http_request.h
- Revision:
- 40:8fe3b866f1f4
- Parent:
- 37:98d83ca14b7b
--- a/source/http_request.h Mon Aug 12 11:45:31 2019 +0200
+++ b/source/http_request.h Wed Sep 16 14:40:45 2020 +0900
@@ -93,7 +93,11 @@
protected:
virtual nsapi_error_t connect_socket(char *host, uint16_t port) {
- return ((TCPSocket*)_socket)->connect(host, port);
+ SocketAddress tcp_addr;
+ NetworkInterface::get_default_instance()->gethostbyname(host, &tcp_addr);
+ tcp_addr.set_port(port);
+
+ return ((TCPSocket*)_socket)->connect(tcp_addr);
}
};