diff options
| author | Grant Limberg <grant.limberg@zerotier.com> | 2016-11-04 12:39:57 -0700 |
|---|---|---|
| committer | Grant Limberg <grant.limberg@zerotier.com> | 2016-11-04 12:39:57 -0700 |
| commit | 4762311977a2ebe26c6ac140bdcfc44d7733ff9a (patch) | |
| tree | 472562a36c03dada81b72189c06b518aafed2bc0 /windows/WinUI/APIHandler.cs | |
| parent | a7718bae398c8e910142568d7116c8adedce9d71 (diff) | |
| download | infinitytier-4762311977a2ebe26c6ac140bdcfc44d7733ff9a.tar.gz infinitytier-4762311977a2ebe26c6ac140bdcfc44d7733ff9a.zip | |
work in progress windows UI update
Diffstat (limited to 'windows/WinUI/APIHandler.cs')
| -rw-r--r-- | windows/WinUI/APIHandler.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/windows/WinUI/APIHandler.cs b/windows/WinUI/APIHandler.cs index 92b83021..83a22c66 100644 --- a/windows/WinUI/APIHandler.cs +++ b/windows/WinUI/APIHandler.cs @@ -107,7 +107,7 @@ namespace WinUI } } - public void JoinNetwork(string nwid) + public void JoinNetwork(string nwid, bool allowManaged = false, bool allowGlobal = false, bool allowDefault = false) { var request = WebRequest.Create(url + "/network/" + nwid + "?auth=" + authtoken) as HttpWebRequest; if (request == null) @@ -116,6 +116,17 @@ namespace WinUI } request.Method = "POST"; + request.ContentType = "applicaiton/json"; + + using (var streamWriter = new StreamWriter(((HttpWebRequest)request).GetRequestStream())) + { + string json = "{\"allowManaged\":" + (allowManaged ? "true" : "false") + "," + + "\"allowGlobal\":" + (allowGlobal ? "true" : "false") + "," + + "\"allowDefault\":" + (allowDefault ? "true" : "false") + "}"; + streamWriter.Write(json); + streamWriter.Flush(); + streamWriter.Close(); + } try { |
