[Solved] Find hrefs value in string

[ad_1] Extend the capturing group around the “one or more not white space” LinkParser = new Regex(@”\b(?<url>https?://\S+)[‘””]”, RegexOptions.Compiled | RegexOptions.IgnoreCase); Then access the match collection with m.Groups[“url”].Value A simpler pattern might also work well: \b(?<url>http.*?)[‘”] These are very primitive and I wouldn’t guarantee it works in all cases. If you have urls that aren’t quoted … Read more

[Solved] HttpClient what and for what? [closed]

[ad_1] This should give you a start: private Order SendOrderRequest(Models.OrderTest model) { Uri uri = new Uri(model.BaseUrl + “order”); HttpClient client = new HttpClient(); client.BaseAddress = uri; var mediaType = new MediaTypeHeaderValue(“application/json”); var jsonFormatter = new JsonMediaTypeFormatter(); HttpContent content = new ObjectContent<Order>(model.Order, jsonFormatter); HttpResponseMessage responseMessage = client.PostAsync(uri, content).Result; return responseMessage.Content.ReadAsAsync(typeof(Supertext.API.POCO.Order)).Result as Supertext.API.POCO.Order; } It just … Read more