Answer the question
In order to leave comments, you need to log in
HttpClient not sending POST data to server?
private void registerToken(String token) {
Log.d("MyToken", "Refreshed token: " + token);
OkHttpClient client = new OkHttpClient();
RequestBody body = new FormBody.Builder()
.add("token","tokenn")
.build();
Request request = new Request.Builder()
.url("http://site.ru/site/devices/")
.post(body)
.build();
try {
client.newCall(request).execute();
} catch (IOException e) {
e.printStackTrace();
}
}
public function actionDevices ()
{
// if (null != Yii::$app->request->post('token'))
// {
$model = new Android();
$model->token = 'test_token';
$model->save();
// }
die('devices');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question