You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
600 B
Java
21 lines
600 B
Java
package sh.adb.RandomRedditMemesAPI;
|
|
|
|
import com.sun.net.httpserver.HttpExchange;
|
|
import com.sun.net.httpserver.HttpHandler;
|
|
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.io.OutputStream;
|
|
|
|
class FallbackHandler implements HttpHandler {
|
|
@Override
|
|
public void handle(HttpExchange t) throws IOException {
|
|
InputStream is = t.getRequestBody();
|
|
//is.read();
|
|
String response = "404";
|
|
t.sendResponseHeaders(404, response.length());
|
|
OutputStream os = t.getResponseBody();
|
|
os.write(response.getBytes());
|
|
os.close();
|
|
}
|
|
} |