Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

php webrequest/webresponse

Empfohlene Antworten

Veröffentlicht

Hallo,

um eine Anwendung zu konfigurieren möchte ich auf entsprechende Skripte auf dessen embedded Webserver zugreifen und per request / response die Konfigdaten auslesen bzw setzen. Der Skripte sind durch Username/Passwd geschützt.

In C# habe ich das bereits hinbekommen, allerdings ist nun auch eine php Variante gewünscht. Wer kann mir da weiterhelfen, bzw Links oder Tipps geben.

Dank und Gruss

jmatthes

In c# würde das so aussehen:


...

            WebRequest request = WebRequest.Create(authn.Url);

            request.Credentials = new NetworkCredential(authn.UserName, authn.Password);

            request.PreAuthenticate = true;


            // Set values for the request back 

            request.Method = "POST";

            request.ContentType = "application/x-www-form-urlencoded";

            request.ContentLength = authn.Parameter.Length;


            // Write the request 

            StreamWriter stOut = new StreamWriter(request.GetRequestStream(), System.Text.Encoding.ASCII);

            stOut.Write(authn.Parameter);

            stOut.Close();

...

bzw .

...

            WebRequest request = WebRequest.Create(strUrl);

            request.Credentials = new NetworkCredential(strUser, strPwd);

            request.PreAuthenticate = true;


            // Den Antwort-Stream lesen.

            WebResponse responseHtml = request.GetResponse();

            StreamReader r = new StreamReader(responseHtml.GetResponseStream());

            string htmlContent = r.ReadToEnd();

            r.Close();

...

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.