我正在尝试解决这个问题,但我不知道我做错了什么?
这是文档https://duo.com/docs/adminapi#create-user
import java.io.*;
import java.net.URL;
import java.net.HttpURLConnection;
public class duo {
public static void main(String[] args) throws IOException, InterruptedException {
// Create a neat value object to hold the URL
URL url;
url = new URL("?Authorization =Basic&Integration key: Secret key=DILV:DLr5bzSztv&Date=Sat, 14 Aug 2021 02:19:40 +0000&Content-Type: application/x-www-form-urlencoded=api-e9770554.duosecurity.com&=/admin/v1/users&=username=xyz");
// Open a connection(?) on the URL(??) and cast the response(???)
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
// Now it's "open", we can set the request method, headers etc.
connection.setRequestProperty("accept", "application/json");
// This line makes the request
InputStream responseStream = connection.getInputStream();
}
}
错误
{
"code": 40401,
"message": "Resource not found",
"stat": "FAIL"
}