Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
sdk:webservices_get [2023/09/06 07:41] fachetsdk:webservices_get [2023/09/06 07:56] (current) fachet
Line 1: Line 1:
-<code c nb_transfer_post_with_parameters.are>+<code c nb_transfer_get_with_parameters.are>
 /* DESC: This script will supervise a specified host. /* DESC: This script will supervise a specified host.
  * Copyright (C) 2023 NetModule AG, Switzerland, rfa  * Copyright (C) 2023 NetModule AG, Switzerland, rfa
  */  */
  
-// int nb_transfer_post ( string usr, string pwd, string url, string path, string pp+// int nb_transfer_get(string usr, string pwd, string url, string path) 
-// https://httpbin.org/post?par=val&par...+// https://httpbin.org/get?par=val&par...
  
 usr = ""; usr = "";
 pwd = ""; pwd = "";
-pp=""; 
 file = "out.txt"; file = "out.txt";
  
 company = "NetModule"; company = "NetModule";
 data = "12.345"; data = "12.345";
-url = sprintf("https://httpbin.org/post?company=%s&data=%s", company, data);+url = sprintf("https://httpbin.org/get?company=%s&data=%s", company, data);
  
-ret = nb_transfer_post(usr , pwd , url, file, pp);+ret = nb_transfer_get(usr , pwd , url, file);
  
-printf("nb_transfer_post() returns: %s\n", ret == -1 ? "ERROR" : "OK");+printf("nb_transfer_get() returns: %s\n", ret == -1 ? "ERROR" : "OK");
 printf(fread(fopen(file, "r"), 1024)); printf(fread(fopen(file, "r"), 1024));
 </code> </code>
 +{{:sdk:nb_transfer_get.png?800|}}