Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pass optional parameters as params
#5
Arrays with any number of elements can be passed using JSON. The new HTTP server code makes it easier.
 
Code:
Copy      Help
// class "HTTP server Functions test.cs"
using System.Text.Json.Nodes;

static partial class Functions {
    //client example: LaHttp.CallJ("TestJsonArray", new string[] { "a", "b" });
    //client example without LaHttp: internet.http.Post("http://localhost:4455/TestJsonArray", internet.jsonContent(new string[] { "a", "b" }));

    public static void TestJsonArray(string[] a) {
        foreach (string v in a) {
            print.it(v);
        }
    }
}


Messages In This Thread
pass optional parameters as params - by Davider - 05-05-2024, 09:47 PM
RE: pass optional parameters as params - by Gintaras - 05-06-2024, 07:54 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)