-
Notifications
You must be signed in to change notification settings - Fork 0
/
MenuController.cs
44 lines (41 loc) · 1.51 KB
/
MenuController.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using DashboardPage.Models;
using Microsoft.AspNetCore.Mvc;
// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace DashboardPage.Controllers
{
public class MenuController : Controller
{
private readonly IMenuRepository _MenuRepository;
public MenuController(IMenuRepository menuRepository)
{
_MenuRepository = menuRepository;
}
public ViewResult List()
{
return View(_MenuRepository.AllMenu);
}
public string SampleGet()
{
string strurltest = String.Format("https://adidaasdataservices.azurewebsites.net/Misc/GetReports");
WebRequest requestObject = WebRequest.Create(strurltest);
requestObject.Method = "GET";
HttpWebResponse responseObject = null;
requestObject.Headers.Add("Authorization", "Basic YWRpZGFhczpEaXN5c0AzMjE=");
responseObject = (HttpWebResponse)requestObject.GetResponse();
string strresulttest = null;
using (Stream stream = responseObject.GetResponseStream())
{
StreamReader sr = new StreamReader(stream);
strresulttest = sr.ReadToEnd();
sr.Close();
}
return strresulttest;
}
}
}