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:28] fachetsdk:webservices_get [2023/09/06 07:56] (current) fachet
Line 1: Line 1:
 +<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_get ( string usr, string pwd, string url, string path) +// int nb_transfer_get(string usr, string pwd, string url, string path) 
-// https://httpbin.org/response-headers?key=val&key=val...+// https://httpbin.org/get?par=val&par...
  
 usr = ""; usr = "";
Line 12: Line 13:
 company = "NetModule"; company = "NetModule";
 data = "12.345"; data = "12.345";
-url = sprintf("https://httpbin.org/response-headers?company=%s&data=%s", company, data);+url = sprintf("https://httpbin.org/get?company=%s&data=%s", company, data);
  
-ret = nb_transfer_get (usr , pwd , url, file);+ret = nb_transfer_get(usr , pwd , url, file);
  
-printf("return: %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>
 +{{:sdk:nb_transfer_get.png?800|}}