Click here to Skip to main content
15,887,683 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Securing A Web API Pin
Kevin Marois2-Nov-21 4:35
professionalKevin Marois2-Nov-21 4:35 
QuestionLaravel 8 how to add elements to navbar app.blade Pin
paradox0215-Sep-21 2:01
paradox0215-Sep-21 2:01 
QuestionSSL Certificate Pin
Kevin Marois26-Aug-21 7:23
professionalKevin Marois26-Aug-21 7:23 
AnswerRe: SSL Certificate Pin
Richard Deeming26-Aug-21 21:52
mveRichard Deeming26-Aug-21 21:52 
GeneralRe: SSL Certificate Pin
Kevin Marois20-Sep-21 9:23
professionalKevin Marois20-Sep-21 9:23 
GeneralRe: SSL Certificate Pin
Richard Deeming20-Sep-21 21:47
mveRichard Deeming20-Sep-21 21:47 
GeneralRe: SSL Certificate Pin
Kevin Marois21-Sep-21 4:22
professionalKevin Marois21-Sep-21 4:22 
GeneralRe: SSL Certificate Pin
Richard Deeming21-Sep-21 5:36
mveRichard Deeming21-Sep-21 5:36 
GeneralRe: SSL Certificate Pin
Kevin Marois21-Sep-21 6:02
professionalKevin Marois21-Sep-21 6:02 
GeneralRe: SSL Certificate Pin
Richard Deeming21-Sep-21 6:37
mveRichard Deeming21-Sep-21 6:37 
GeneralRe: SSL Certificate Pin
Kevin Marois21-Sep-21 6:53
professionalKevin Marois21-Sep-21 6:53 
GeneralRe: SSL Certificate Pin
SlothTheCoder29-Oct-21 15:11
professionalSlothTheCoder29-Oct-21 15:11 
QuestionAPI Controller Question Pin
Kevin Marois26-Aug-21 6:13
professionalKevin Marois26-Aug-21 6:13 
AnswerRe: API Controller Question Pin
Richard Deeming26-Aug-21 6:41
mveRichard Deeming26-Aug-21 6:41 
GeneralRe: API Controller Question Pin
Kevin Marois26-Aug-21 7:28
professionalKevin Marois26-Aug-21 7:28 
GeneralRe: API Controller Question Pin
Richard Deeming26-Aug-21 21:41
mveRichard Deeming26-Aug-21 21:41 
QuestionModal Question Pin
MekaC24-Aug-21 10:40
MekaC24-Aug-21 10:40 
Question.Net Framework Web API - Server Error Pin
Kevin Marois23-Aug-21 11:50
professionalKevin Marois23-Aug-21 11:50 
AnswerRe: .Net Framework Web API - Server Error Pin
Richard Deeming23-Aug-21 21:18
mveRichard Deeming23-Aug-21 21:18 
GeneralRe: .Net Framework Web API - Server Error Pin
Kevin Marois24-Aug-21 4:36
professionalKevin Marois24-Aug-21 4:36 
GeneralRe: .Net Framework Web API - Server Error Pin
Richard Deeming24-Aug-21 6:13
mveRichard Deeming24-Aug-21 6:13 
GeneralRe: .Net Framework Web API - Server Error Pin
Kevin Marois24-Aug-21 6:27
professionalKevin Marois24-Aug-21 6:27 
QuestionWebrequest is obselete what is the alternatieve Pin
Ger F. Versteeg26-Jul-21 23:45
Ger F. Versteeg26-Jul-21 23:45 
Hello,
This is my program with the obsolete WebRequest.
Who will help me to set this up with HttpClient.
Thanks in advance, Ger

		public ToProgModel ProgCsv(Uri webSiteProg, ToProgModel prog, string complexProg)
		{
			string ProgTextString;

			try
			{
				var AuthorisatorProg = _config.GetConnectionString("AuthorisatorProg");
				var PasswordProg = _config.GetConnectionString("PasswordProg");

#pragma warning disable SYSLIB0014 // Type or member is obsolete
				WebRequest webrequest = WebRequest.Create(webSiteProg);
#pragma warning restore SYSLIB0014 // Type or member is obsolete

				SetBasicAuthHeader(webrequest, AuthorisatorProg, PasswordProg);
				WebResponse webresponse = webrequest.GetResponse();
				Stream webstream = webresponse.GetResponseStream();
				StreamReader streamreader = new(webstream);
				ProgTextString = streamreader.ReadToEnd();

				webresponse.Close();
				webresponse.Dispose();
				streamreader.Dispose();
				webstream.Dispose();
			}
			catch (HttpRequestException ex)
			{
				prog.Ret = $"Http response EX: {ex.Message}";
				return null;
			}

			//............
			//............

			return prog;
		}

		public void SetBasicAuthHeader(WebRequest request, string userName, string userPassword)
		{
			string authInfo = userName + ":" + userPassword;
			authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
			request.Headers["Authorization"] = "Basic " + authInfo;
		}

AnswerRe: Webrequest is obselete what is the alternatieve Pin
Richard Deeming27-Jul-21 23:57
mveRichard Deeming27-Jul-21 23:57 
GeneralRe: Webrequest is obselete what is the alternatieve Pin
Ger F. Versteeg28-Jul-21 0:58
Ger F. Versteeg28-Jul-21 0:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.