static string baseUrl="https://www.gov.il";
public static void Main()
string res= TestOfficeGetPublicationsDrushimFunc();
public static string TestOfficeGetPublicationsDrushimFunc()
string response = GetResponesPostRequest(baseUrl + "/he/api/StripsApi/GetPublications", "office", "ministry_of_public_security", baseUrl);
public static string GetResponesPostRequest(string api, string modelView, string url, string env)
WebClient client = SetClient();
string model = baseUrl + "/he/api/StripsApi/ModelView?ModelName=" + modelView + "&urlName=" + url;
var finalModel = client.DownloadString(model);
finalModel = finalModel.Substring(0, finalModel.Length - 1); ;
var finalModel1 = finalModel + ",\"PrivateZone\":null,\"urlName\":\"" +url+ "\"}";
string toBeSearched = "ModelView";
int ix = finalModel1.IndexOf(toBeSearched);
string code = finalModel1.Substring(ix + toBeSearched.Length);
var finalModel2 = finalModel1.Substring(ix);
finalModel2 = "{\"" + finalModel2;
finalModel2 = finalModel2.Replace("ModelView", "ViewModel");
WebClient client1 = SetClient();
reponse = client1.UploadString(api, finalModel2);
public static WebClient SetClient()
using (var client = new WebClient())
client.Headers[HttpRequestHeader.ContentType] = "application/json";
client.Headers[HttpRequestHeader.UserAgent] = ".NET Framework Client";
System.Net.ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
client.Encoding = System.Text.Encoding.UTF8;