Pooya1 Active Member Licensed User Jan 22, 2018 #1 I use below code for basic4android Code: Copy Job.PostString("http://example.com/check.php","id=1") Job.GetRequest.InitializeDELETE2(http://example.com/check.php","id=1".GetBytes("UTF8")) And below code for basic4ios Code: Copy Job.PostString("http://example.com/check.php","id=1") Job.GetRequest.InitializeDelete("http://example.com/check.php?id=1") Android is working but iOS not working Actually send null to script Why?
I use below code for basic4android Code: Copy Job.PostString("http://example.com/check.php","id=1") Job.GetRequest.InitializeDELETE2(http://example.com/check.php","id=1".GetBytes("UTF8")) And below code for basic4ios Code: Copy Job.PostString("http://example.com/check.php","id=1") Job.GetRequest.InitializeDelete("http://example.com/check.php?id=1") Android is working but iOS not working Actually send null to script Why?
OliverA Expert Licensed User Longtime User Jan 22, 2018 #2 InitializeDelete2 <> InitializeDelete. InitializeDelete2 sends data "id=1".GetBytes("UTF8") Click to expand... to the link you provided http://example.com/check.php Click to expand... InitializeDelete on the other hand sends no data and the data encoded in the URL seems to be ignored (since that is not how the DELETE command works: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE ). So you are using two different methods for sending a DELETE command and you are getting two different results. Upvote 0
InitializeDelete2 <> InitializeDelete. InitializeDelete2 sends data "id=1".GetBytes("UTF8") Click to expand... to the link you provided http://example.com/check.php Click to expand... InitializeDelete on the other hand sends no data and the data encoded in the URL seems to be ignored (since that is not how the DELETE command works: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE ). So you are using two different methods for sending a DELETE command and you are getting two different results.
Pooya1 Active Member Licensed User Jan 22, 2018 #3 OliverA said: InitializeDelete2 <> InitializeDelete. InitializeDelete2 sends data to the link you provided InitializeDelete on the other hand sends no data and the data encoded in the URL seems to be ignored (since that is not how the DELETE command works: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE ). So you are using two different methods for sending a DELETE command and you are getting two different results. Click to expand... Thank you But i am beginner in programming Do you can give me sample? I'm sorry for my request Upvote 0
OliverA said: InitializeDelete2 <> InitializeDelete. InitializeDelete2 sends data to the link you provided InitializeDelete on the other hand sends no data and the data encoded in the URL seems to be ignored (since that is not how the DELETE command works: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/DELETE ). So you are using two different methods for sending a DELETE command and you are getting two different results. Click to expand... Thank you But i am beginner in programming Do you can give me sample? I'm sorry for my request
OliverA Expert Licensed User Longtime User Jan 22, 2018 #4 Pooya1 said: Job.GetRequest.InitializeDELETE2(http://example.com/check.php","id=1".GetBytes("UTF8")) Click to expand... Use this in B4i just like you did for B4a. Upvote 0
Pooya1 said: Job.GetRequest.InitializeDELETE2(http://example.com/check.php","id=1".GetBytes("UTF8")) Click to expand... Use this in B4i just like you did for B4a.
Pooya1 Active Member Licensed User Jan 22, 2018 #5 OliverA said: Use this in B4i just like you did for B4a. Click to expand... Exist Delete2 method for HttpUtil in b4i Is it working? Code: Copy Job.Delete2("http://example.com/check.php","id=1".GetBytes("UTF8")) Upvote 0
OliverA said: Use this in B4i just like you did for B4a. Click to expand... Exist Delete2 method for HttpUtil in b4i Is it working? Code: Copy Job.Delete2("http://example.com/check.php","id=1".GetBytes("UTF8"))
Pooya1 Active Member Licensed User Jan 22, 2018 #6 I use below code but not working Code: Copy Job.Delete2(url,Array As String("id","31123")) Upvote 0
OliverA Expert Licensed User Longtime User Jan 22, 2018 #7 FYI: Never used these methods before. But looking at your initial post the method is InitializeDelete2, not Delete2. If it does not exist in B4i, you may need to post another question and see if someone knows how to add it. Upvote 0
FYI: Never used these methods before. But looking at your initial post the method is InitializeDelete2, not Delete2. If it does not exist in B4i, you may need to post another question and see if someone knows how to add it.
Erel B4X founder Staff member Licensed User Longtime User Jan 23, 2018 #8 The products names are B4A and B4i. The correct way to create a DELETE request is with HttpJob.Delete or Delete2. DELETE requests usually do not have a request body. What are you communicating with? Upvote 0
The products names are B4A and B4i. The correct way to create a DELETE request is with HttpJob.Delete or Delete2. DELETE requests usually do not have a request body. What are you communicating with?
Pooya1 Active Member Licensed User Jan 23, 2018 #9 Erel said: The products names are B4A and B4i. The correct way to create a DELETE request is with HttpJob.Delete or Delete2. DELETE requests usually do not have a request body. What are you communicating with? Click to expand... I am communicating with web service that use restful protocol for it I can use in B4a but in B4i not send any data It is important point in my app Thanks Upvote 0
Erel said: The products names are B4A and B4i. The correct way to create a DELETE request is with HttpJob.Delete or Delete2. DELETE requests usually do not have a request body. What are you communicating with? Click to expand... I am communicating with web service that use restful protocol for it I can use in B4a but in B4i not send any data It is important point in my app Thanks
Erel B4X founder Staff member Licensed User Longtime User Jan 23, 2018 #10 Try this: Code: Copy Dim j As HttpJob j.Initialize("", Me) j.PostBytes("link here ", "aaa".GetBytes("utf8")) Dim no As NativeObject = j.GetRequest no.GetField("object").RunMethod("setHTTPMethod:", Array("DELETE")) Upvote 0
Try this: Code: Copy Dim j As HttpJob j.Initialize("", Me) j.PostBytes("link here ", "aaa".GetBytes("utf8")) Dim no As NativeObject = j.GetRequest no.GetField("object").RunMethod("setHTTPMethod:", Array("DELETE"))
Pooya1 Active Member Licensed User Jan 23, 2018 #11 Erel said: Try this: Code: Copy Dim j As HttpJob j.Initialize("", Me) j.PostBytes("link here ", "aaa".GetBytes("utf8")) Dim no As NativeObject = j.GetRequest no.GetField("object").RunMethod("setHTTPMethod:", Array("DELETE")) Click to expand... Yes of course ,I'm going to try Upvote 0
Erel said: Try this: Code: Copy Dim j As HttpJob j.Initialize("", Me) j.PostBytes("link here ", "aaa".GetBytes("utf8")) Dim no As NativeObject = j.GetRequest no.GetField("object").RunMethod("setHTTPMethod:", Array("DELETE")) Click to expand... Yes of course ,I'm going to try
Pooya1 Active Member Licensed User Jan 23, 2018 #12 Erel said: Try this: Code: Copy Dim j As HttpJob j.Initialize("", Me) j.PostBytes("link here ", "aaa".GetBytes("utf8")) Dim no As NativeObject = j.GetRequest no.GetField("object").RunMethod("setHTTPMethod:", Array("DELETE")) Click to expand... Yes it is working Erel can i use this code for PUT method or other? Upvote 0
Erel said: Try this: Code: Copy Dim j As HttpJob j.Initialize("", Me) j.PostBytes("link here ", "aaa".GetBytes("utf8")) Dim no As NativeObject = j.GetRequest no.GetField("object").RunMethod("setHTTPMethod:", Array("DELETE")) Click to expand... Yes it is working Erel can i use this code for PUT method or other?
Erel B4X founder Staff member Licensed User Longtime User Jan 23, 2018 #13 Use Job.PutBytes or PutString to create a PUT request. Upvote 0