Answer the question
In order to leave comments, you need to log in
Is it possible to send a post request to a form?
I am creating an application from the site using this library for android https://github.com/VishnuSivadasVS/Advanced-HttpUR...
The video is quite clear, but it shows how to log in by directing the user to the post executor file or get requests register.php endlogin.php. Is it possible to use this or a similar library to make the post request not be sent to a direct executor file, but let's say send a post request to such a link? b99437dx.beget.tech/account/login
Here's what I got but authorization fails
login_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
final String username;
final String password;
username = String.valueOf(inputUsername.getText());
password = String.valueOf(inputPassword.getText());
if(!username.equals("") && !password.equals("")) {
Handler handler = new Handler();
handler.post(new Runnable() {
@Override
public void run() {
String[] field = new String[2];
field[0] = "user_name";
field[1] = "password";
String[] data = new String[2];
data[0] = username;
data[1] = password;
PutData putData = new PutData("http://b99437dx.beget.tech/account/login", "POST", field, data);
if(putData.startPut()) {
if(putData.onComplete()) {
String result = putData.getResult();
if(result.equals("")){
Toast.makeText(getApplicationContext(), "SUCCESS!", Toast.LENGTH_SHORT).show();
startActivity(new Intent(getApplicationContext(), MainActivity.class));
finish();
}
}
}
}
});
}
}
});
Answer the question
In order to leave comments, you need to log in
the post request was not sent to a direct filewhatoooo
send a post request to this linkWell, yes,
so that you can send requests directly to the field on the sitewhat kind of nonsense is this , in
I would be grateful if you could tell me similar libraries for android so that you can send requests directly to the field on the site
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question