(self, endpoint, data, print_info=None)
| 69 | # API POST call. |
| 70 | # Data should be passed in as a map. The map will be converted to string. |
| 71 | def __api_POST(self, endpoint, data, print_info=None): |
| 72 | if not print_info: |
| 73 | print_info = "API::POST(" + endpoint + ")" |
| 74 | |
| 75 | # Convert data to str |
| 76 | data_str = "" |
| 77 | for x, y in data.items(): |
| 78 | data_str += '"' + x + '":"' + y + '",' |
| 79 | data_str = ("{" + data_str[:-1] + "}").encode("utf-8") |
| 80 | data = data_str |
| 81 | |
| 82 | return self.__api_call(requests.post, endpoint, print_info, data) |
| 83 | |
| 84 | # API DELETE call. |
| 85 | def __api_DELETE(self, endpoint, print_info): |
no test coverage detected