UnityWebRequest Post function doesn't work? [duplicate]
This question already has an answer here:
Sending http requests in C# with Unity
2 answers
I am trying to make a Post request using the UnityWebRequest class.
Everything works well if I use this:
IEnumerator Loginplayer_old()
{
print("Login");
WWWForm form = new WWWForm();
form.AddField("name", Login_Field_name.text);
form.AddField("password", Login_Field_Password.text);
WWW www = new WWW("http://localhost/sqlconnect/register.php", form);
yield return www;
}
But if I use the Post function like this it doesn't work at all:
IEnumerator Loginplayer_old()
{
print("Login");
WWWForm form = new WWWForm();
form.AddField("name", Login_Field_name.text);
form.AddField("password", Login_Field_Password.text);
UnityWebRequest www = UnityWebRequest.Post("http://localhost/sqlconnect/register.php", form);
yield return www;
}
What should I do to get this working?
php unity3d http-post unityscript
marked as duplicate by Programmer
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 25 '18 at 18:34
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Sending http requests in C# with Unity
2 answers
I am trying to make a Post request using the UnityWebRequest class.
Everything works well if I use this:
IEnumerator Loginplayer_old()
{
print("Login");
WWWForm form = new WWWForm();
form.AddField("name", Login_Field_name.text);
form.AddField("password", Login_Field_Password.text);
WWW www = new WWW("http://localhost/sqlconnect/register.php", form);
yield return www;
}
But if I use the Post function like this it doesn't work at all:
IEnumerator Loginplayer_old()
{
print("Login");
WWWForm form = new WWWForm();
form.AddField("name", Login_Field_name.text);
form.AddField("password", Login_Field_Password.text);
UnityWebRequest www = UnityWebRequest.Post("http://localhost/sqlconnect/register.php", form);
yield return www;
}
What should I do to get this working?
php unity3d http-post unityscript
marked as duplicate by Programmer
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 25 '18 at 18:34
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Sending http requests in C# with Unity
2 answers
I am trying to make a Post request using the UnityWebRequest class.
Everything works well if I use this:
IEnumerator Loginplayer_old()
{
print("Login");
WWWForm form = new WWWForm();
form.AddField("name", Login_Field_name.text);
form.AddField("password", Login_Field_Password.text);
WWW www = new WWW("http://localhost/sqlconnect/register.php", form);
yield return www;
}
But if I use the Post function like this it doesn't work at all:
IEnumerator Loginplayer_old()
{
print("Login");
WWWForm form = new WWWForm();
form.AddField("name", Login_Field_name.text);
form.AddField("password", Login_Field_Password.text);
UnityWebRequest www = UnityWebRequest.Post("http://localhost/sqlconnect/register.php", form);
yield return www;
}
What should I do to get this working?
php unity3d http-post unityscript
This question already has an answer here:
Sending http requests in C# with Unity
2 answers
I am trying to make a Post request using the UnityWebRequest class.
Everything works well if I use this:
IEnumerator Loginplayer_old()
{
print("Login");
WWWForm form = new WWWForm();
form.AddField("name", Login_Field_name.text);
form.AddField("password", Login_Field_Password.text);
WWW www = new WWW("http://localhost/sqlconnect/register.php", form);
yield return www;
}
But if I use the Post function like this it doesn't work at all:
IEnumerator Loginplayer_old()
{
print("Login");
WWWForm form = new WWWForm();
form.AddField("name", Login_Field_name.text);
form.AddField("password", Login_Field_Password.text);
UnityWebRequest www = UnityWebRequest.Post("http://localhost/sqlconnect/register.php", form);
yield return www;
}
What should I do to get this working?
This question already has an answer here:
Sending http requests in C# with Unity
2 answers
php unity3d http-post unityscript
php unity3d http-post unityscript
edited Nov 25 '18 at 11:46
martin clayton
65.5k17186180
65.5k17186180
asked Nov 25 '18 at 9:32
Gobla GameGobla Game
215
215
marked as duplicate by Programmer
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 25 '18 at 18:34
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Programmer
StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 25 '18 at 18:34
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You have to send it if using UnityWebRequest
, it is not automatic:
yield return www.SendWebRequest(); // not simply yield return www
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You have to send it if using UnityWebRequest
, it is not automatic:
yield return www.SendWebRequest(); // not simply yield return www
add a comment |
You have to send it if using UnityWebRequest
, it is not automatic:
yield return www.SendWebRequest(); // not simply yield return www
add a comment |
You have to send it if using UnityWebRequest
, it is not automatic:
yield return www.SendWebRequest(); // not simply yield return www
You have to send it if using UnityWebRequest
, it is not automatic:
yield return www.SendWebRequest(); // not simply yield return www
answered Nov 25 '18 at 9:47
Yuri NudelmanYuri Nudelman
1,3341612
1,3341612
add a comment |
add a comment |