Changed some API calls to use POST method.

This commit is contained in:
Jose Marcial Vieira Bisneto 2017-10-12 20:12:28 -03:00
parent 4e556221bd
commit ae6fe6dc29
No known key found for this signature in database
GPG key ID: 103E935E7E6E831E
3 changed files with 5 additions and 5 deletions

View file

@ -295,7 +295,7 @@ int ipfs_exporter_object_cat(struct CliArguments* args, FILE* output_file) {
request->arguments = libp2p_utils_vector_new(1);
libp2p_utils_vector_add(request->arguments, hash);
size_t response_size = 0;
int retVal = ipfs_core_http_request_get(local_node, request, &response, &response_size);
int retVal = ipfs_core_http_request_post(local_node, request, &response, &response_size, "", 0);
if (response != NULL && response_size > 0) {
fwrite(response, 1, response_size, output_file);
free(response);

View file

@ -21,7 +21,7 @@ int ipfs_name_publish(struct IpfsNode* local_node, char* name) {
request->sub_command = "publish";
libp2p_utils_vector_add(request->arguments, name);
size_t response_size = 0;
int retVal = ipfs_core_http_request_get(local_node, request, &response, &response_size);
int retVal = ipfs_core_http_request_post(local_node, request, &response, &response_size, "", 0);
if (response != NULL && response_size > 0) {
fwrite(response, 1, response_size, stdout);
free(response);
@ -40,7 +40,7 @@ int ipfs_name_resolve(struct IpfsNode* local_node, char* name) {
request->sub_command = "resolve";
libp2p_utils_vector_add(request->arguments, name);
size_t response_size = 0;
int retVal = ipfs_core_http_request_get(local_node, request, &response, &response_size);
int retVal = ipfs_core_http_request_post(local_node, request, &response, &response_size, "", 0);
if (response != NULL && response_size > 0) {
fwrite(response, 1, response_size, stdout);
free(response);

View file

@ -69,7 +69,7 @@ int ipfs_routing_generic_get_value (ipfs_routing* routing, const unsigned char *
req->arguments = libp2p_utils_vector_new(1);
libp2p_utils_vector_add(req->arguments, buffer);
size_t response_size = 0;
if (!ipfs_core_http_request_get(routing->local_node, req, &response, &response_size)) {
if (!ipfs_core_http_request_post(routing->local_node, req, &response, &response_size, "", 0)) {
libp2p_logger_error("offline", "Unable to call API for dht get.\n");
ipfs_core_http_request_free(req);
return 0;
@ -181,7 +181,7 @@ int ipfs_routing_offline_provide (ipfs_routing* offlineRouting, const unsigned c
request->sub_command = "provide";
libp2p_utils_vector_add(request->arguments, buffer);
size_t response_size = 0;
if (!ipfs_core_http_request_get(offlineRouting->local_node, request, &response, &response_size)) {
if (!ipfs_core_http_request_post(offlineRouting->local_node, request, &response, &response_size, "", 0)) {
libp2p_logger_error("offline", "Unable to call API for dht publish.\n");
ipfs_core_http_request_free(request);
return 0;