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.

Empfohlene Antworten

Veröffentlicht

Hi,

ich schreibe gerade ein Programm,

dass eine gewisse Anzahl von Strings an einen Server sendet.

Nun will ich wissen ob diese nun gültig sind oder nicht.

Also Error 404 oder 403 oder nicht...


.

.

.

 {

		for(int i = 0; i < Test.length; i++)

			{


			Socket socket = new Socket(host, port);

			InputStream input = socket.getInputStream();

			OutputStream request = socket.getOutputStream();


			String s = "GET /" + Test[i] + "\n";

			request.write(s.getBytes()); 

			request.flush();


			byte[] buffer = new byte[10];

			int bytes;

			while((bytes = input.read(buffer)) != -1){

			response.write(buffer, 0, bytes);


			}

			request.close();

			input.close();

			socket.close();


		}

	} 

.

.

.

Wie kann ich hieraus die Statusnachricht auslesen?

Ich habe mir gedacht, dass ich den response in einen String umwandle

und ihn dann mit nem anderen String vergleich usw

Die Frage ist für mich nun, wie kriege ich das hin?

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.