1
有人可以幫助我理解這段代碼。在此先感謝。OKHttpClient的目的是什麼?這段代碼有沒有其他選擇?將PHP與Android Studio鏈接以獲取Firebase令牌
private void registerToken(String token) {
OkHttpClient client = new OkHttpClient();
RequestBody body = new FormBody.Builder()
.add("Token",token)
.build();
Request request = new Request.Builder()
.url("notify.php")
.post(body)
.build();
try {
client.newCall(request).execute();
} catch (IOException e) {
e.printStackTrace();
}
}