MCPcopy Create free account
hub / github.com/apple/coremltools / __api_POST

Method __api_POST

mlmodel/docs/readme_session.py:71–82  ·  view source on GitHub ↗
(self, endpoint, data, print_info=None)

Source from the content-addressed store, hash-verified

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):

Callers 3

create_versionMethod · 0.95
update_versionMethod · 0.95
uploadMethod · 0.95

Calls 3

__api_callMethod · 0.95
itemsMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected