Chris Guanzon Active Member Licensed User Longtime User Aug 4, 2020 #1 Can anyone help me how to use putstring with many parameters? here's my code: Code: Copy Connection.PutString(URL & Path, Array As String("old_password", EditText1.Text, "password", EditText2.Text, _ "password_confirmation", EditText3.Text)) i am not sure if this is correct.
Can anyone help me how to use putstring with many parameters? here's my code: Code: Copy Connection.PutString(URL & Path, Array As String("old_password", EditText1.Text, "password", EditText2.Text, _ "password_confirmation", EditText3.Text)) i am not sure if this is correct.
Erel B4X founder Staff member Licensed User Longtime User Aug 4, 2020 #2 What is Connection? What are you trying to do? What happened after you ran this code? Upvote 0
Chris Guanzon Active Member Licensed User Longtime User Aug 4, 2020 #3 Connection is httpjob. This is the error is the code i posted correct? i am trying to update the password using PUT. But i can't pass the parameters needed. Upvote 0
Connection is httpjob. This is the error is the code i posted correct? i am trying to update the password using PUT. But i can't pass the parameters needed.
drgottjr Expert Licensed User Longtime User Aug 4, 2020 #4 are you sure server accepts a PUT? and even if it did, what you're PUTting, isn't what PUT does. Last edited: Aug 4, 2020 Upvote 0
Chris Guanzon Active Member Licensed User Longtime User Aug 5, 2020 #5 drgottjr said: are you sure server accepts a PUT? and even if it did, what you're PUTting, isn't what PUT does. Click to expand... Yes, it does. i wanna know if my code is correct or i am missing something because it has yellow underline in my code. the error is posted in #3, a screenshot of the error. Upvote 0
drgottjr said: are you sure server accepts a PUT? and even if it did, what you're PUTting, isn't what PUT does. Click to expand... Yes, it does. i wanna know if my code is correct or i am missing something because it has yellow underline in my code. the error is posted in #3, a screenshot of the error.
drgottjr Expert Licensed User Longtime User Aug 5, 2020 #6 you are not using PUT correctly. what you probably mean to use is POST. as far as the "error" is concerned, it's a "warning". it says warning. as far as the "object" mentioned is concerned, there is no way to know what it refers to, given what you've shared. sorry. Upvote 0
you are not using PUT correctly. what you probably mean to use is POST. as far as the "error" is concerned, it's a "warning". it says warning. as far as the "object" mentioned is concerned, there is no way to know what it refers to, given what you've shared. sorry.
Chris Guanzon Active Member Licensed User Longtime User Aug 5, 2020 #7 drgottjr said: you are not using PUT correctly. what you probably mean to use is POST. as far as the "error" is concerned, it's a "warning". it says warning. as far as the "object" mentioned is concerned, there is no way to know what it refers to, given what you've shared. sorry. Click to expand... What is the correct code to use PUTSTRING with multiple parameters? can you help me with this? Upvote 0
drgottjr said: you are not using PUT correctly. what you probably mean to use is POST. as far as the "error" is concerned, it's a "warning". it says warning. as far as the "object" mentioned is concerned, there is no way to know what it refers to, given what you've shared. sorry. Click to expand... What is the correct code to use PUTSTRING with multiple parameters? can you help me with this?
OliverA Expert Licensed User Longtime User Aug 5, 2020 #8 The second parameter should be a string, not an array. If you are trying to pass an url encoding Parameter string, you could use UrlEncodeMap to generate the string: https://www.b4x.com/android/forum/threads/b4x-urlencodemap.118626/ Upvote 0
The second parameter should be a string, not an array. If you are trying to pass an url encoding Parameter string, you could use UrlEncodeMap to generate the string: https://www.b4x.com/android/forum/threads/b4x-urlencodemap.118626/
Chris Guanzon Active Member Licensed User Longtime User Aug 5, 2020 #9 OliverA said: The second parameter should be a string, not an array. If you are trying to pass an url encoding Parameter string, you could use UrlEncodeMap to generate the string: https://www.b4x.com/android/forum/threads/b4x-urlencodemap.118626/ Click to expand... I am using OkhttpUtils2 with httpjob.putstring Upvote 0
OliverA said: The second parameter should be a string, not an array. If you are trying to pass an url encoding Parameter string, you could use UrlEncodeMap to generate the string: https://www.b4x.com/android/forum/threads/b4x-urlencodemap.118626/ Click to expand... I am using OkhttpUtils2 with httpjob.putstring
Erel B4X founder Staff member Licensed User Longtime User Aug 5, 2020 #10 Chris Guanzon said: I am using OkhttpUtils2 with httpjob.putstring Click to expand... That's clear. The second parameter should be a string. It is up to you to build this string in the required format. Upvote 0
Chris Guanzon said: I am using OkhttpUtils2 with httpjob.putstring Click to expand... That's clear. The second parameter should be a string. It is up to you to build this string in the required format.
Chris Guanzon Active Member Licensed User Longtime User Aug 5, 2020 #11 I found the solutions: B4X: Copy Dim m As Map m.Initialize m.Put("old_password", EditText1.Text) m.Put("password", EditText2.Text) m.Put("password_confirmation", EditText3.Text) Dim jSONGen As JSONGenerator jSONGen.Initialize(m) Dim strJSONGen As String strJSONGen = jSONGen.ToString then B4X: Copy Connection.PutString(URL & Path, strJSONGen) Thanks for the reply and help. Last edited: Aug 5, 2020 Upvote 0
I found the solutions: B4X: Copy Dim m As Map m.Initialize m.Put("old_password", EditText1.Text) m.Put("password", EditText2.Text) m.Put("password_confirmation", EditText3.Text) Dim jSONGen As JSONGenerator jSONGen.Initialize(m) Dim strJSONGen As String strJSONGen = jSONGen.ToString then B4X: Copy Connection.PutString(URL & Path, strJSONGen) Thanks for the reply and help.