NanoHTTPD已删除请求

时间:2015-12-07 07:45:58

标签: android nanohttpd

如何检查库的操作以执行http删除请求。以下代码用于验证sleduyuschischy

@Override
public Response serve(String uri, Method method, Map<String, String> headers, Map<String, String> parms, Map<String, String> files) {

    Log.d(TAG, "serve + method = " + method.name());
    Log.d(TAG, "serve + files = " + files.toString());

    String answer = "";
    try {

        Log.d(TAG, "serve path = " + ROOT + uri);
        FileReader index = new FileReader(ROOT + uri);

        reader = new BufferedReader(index);
        String line = "";
        while ((line = reader.readLine()) != null) {
            answer += line;
        }
        reader.close();

    } catch(IOException ioe) {
        Log.w(TAG, "File not found - " + ioe.toString());
    }

    return newFixedLengthResponse(answer);
}

以下页面布局

<h2>Hello everyone! </h2>
</br>
<form action="action.php" method="post">
<p>Your name: <input type="text" name="name"/></p>

<p>Your age: <input type="text" name="age"/></p>

<p><input type="submit"/></p>

0 个答案:

没有答案