/
BirdLeon
/
ROBLOX2016
Обзор
Документация
Войти
/
BirdLeon
/
ROBLOX2016
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
Android/NativeShell/src/com/roblox/client/http/RbxHttpPostRequest.java
38 строк
1 KB
PatoFlamejanteTV
full source code
19 дек 2024, 19:11
19 дек 2024, 19:11
05db15d
Код
Авторство
О чём код?
package com.roblox.client.http; import android.os.AsyncTask; public class RbxHttpPostRequest extends AsyncTask<Void, Void, HttpResponse>{ private String TAG = "RobloxHTTPPostRequest"; HttpResponse mResponse = null; private String mUrl = null; private String mPostParams = null; private HttpAgent.HttpHeader[] mHeaderList = null; OnRbxHttpRequestFinished mRequestFinished = null; public RbxHttpPostRequest(String url, String postParams, HttpAgent.HttpHeader[] headerList, OnRbxHttpRequestFinished req) { mRequestFinished = req; mUrl = url; mPostParams = postParams; mHeaderList = headerList; if (postParams == null) mPostParams = ""; // if it's null, HttpAgent won't set the request type as POST } @Override protected HttpResponse doInBackground(Void... arg0) { // mResponse = HttpAgent.readUrlToString( mUrl, mPostParams, mHeaderList ); // POST not GET? mResponse = HttpAgent.readUrl(mUrl, mPostParams, mHeaderList); return mResponse; } @Override protected void onPostExecute(HttpResponse result) { super.onPostExecute(result); mRequestFinished.onFinished(mResponse); } public void execute(){ // execute tasks in parallel this.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } }