D devmobile Active Member Licensed User May 21, 2017 #1 Hello I use InitializePut2 from httputil for send data and receive it in php with below code B4X: $requestjson = file_get_contents('php://input'); But InitializePut2 dont send data to php. My basic code : B4X: hu.Initialize("updatecart",Me) hu.PostString("http://example.com/a.php",$"{"name":"omid"}"$) hu.GetRequest.InitializePut2("http://example.com/a.php",$"{"name":"omid"}"$.GetBytes("UTF8"))
Hello I use InitializePut2 from httputil for send data and receive it in php with below code B4X: $requestjson = file_get_contents('php://input'); But InitializePut2 dont send data to php. My basic code : B4X: hu.Initialize("updatecart",Me) hu.PostString("http://example.com/a.php",$"{"name":"omid"}"$) hu.GetRequest.InitializePut2("http://example.com/a.php",$"{"name":"omid"}"$.GetBytes("UTF8"))
Erel B4X founder Staff member Licensed User Longtime User May 21, 2017 #2 This is not the correct way to create a PUT request. You need to download the source code of OkHttpUtils2: https://www.b4x.com/android/forum/threads/okhttp-replaces-the-http-library.54723/ See how PostBytes is implemented and add a similar sub that creates a PUT request. Upvote 0
This is not the correct way to create a PUT request. You need to download the source code of OkHttpUtils2: https://www.b4x.com/android/forum/threads/okhttp-replaces-the-http-library.54723/ See how PostBytes is implemented and add a similar sub that creates a PUT request.
D devmobile Active Member Licensed User May 21, 2017 #3 Erel said: This is not the correct way to create a PUT request. You need to download the source code of OkHttpUtils2: https://www.b4x.com/android/forum/threads/okhttp-replaces-the-http-library.54723/ See how PostBytes is implemented and add a similar sub that creates a PUT request. Click to expand... Erel i cannot use OKHttp because my project is ready for release and cannot change it Maybe use HttpUtil and use PUT method without OKHttp? Upvote 0
Erel said: This is not the correct way to create a PUT request. You need to download the source code of OkHttpUtils2: https://www.b4x.com/android/forum/threads/okhttp-replaces-the-http-library.54723/ See how PostBytes is implemented and add a similar sub that creates a PUT request. Click to expand... Erel i cannot use OKHttp because my project is ready for release and cannot change it Maybe use HttpUtil and use PUT method without OKHttp?
Erel B4X founder Staff member Licensed User Longtime User May 22, 2017 #4 You can also add a PUT method to HttpUtils2 or the old HttpUtils module. Upvote 0
D devmobile Active Member Licensed User May 22, 2017 #5 Erel said: You can also add a PUT method to HttpUtils2 or the old HttpUtils module. Click to expand... Use example this ? hu.GetRequest.InitializePut2 Upvote 0
Erel said: You can also add a PUT method to HttpUtils2 or the old HttpUtils module. Click to expand... Use example this ? hu.GetRequest.InitializePut2
Erel B4X founder Staff member Licensed User Longtime User May 22, 2017 #6 Are you using HttpUtils2 or HttpUtils? Upvote 0
D devmobile Active Member Licensed User May 22, 2017 #7 Erel said: Are you using HttpUtils2 or HttpUtils? Click to expand... Have different between HttpUtils2 and HttpUtils? Upvote 0
Erel said: Are you using HttpUtils2 or HttpUtils? Click to expand... Have different between HttpUtils2 and HttpUtils?
Erel B4X founder Staff member Licensed User Longtime User May 22, 2017 #8 Yes. HttpUtils: https://www.b4x.com/android/forum/t...oid-web-services-are-now-simple.9176/#content HttpUtils2: http://www.b4x.com/forum/basic4andr...web-services-now-even-simpler.html#post109068 If you are using HttpUtils then you should switch to HttpUtils2 or OkHttpUtils2. The API of HttpUtils2 and OkHttpUtils2 is the same. Upvote 0
Yes. HttpUtils: https://www.b4x.com/android/forum/t...oid-web-services-are-now-simple.9176/#content HttpUtils2: http://www.b4x.com/forum/basic4andr...web-services-now-even-simpler.html#post109068 If you are using HttpUtils then you should switch to HttpUtils2 or OkHttpUtils2. The API of HttpUtils2 and OkHttpUtils2 is the same.
D devmobile Active Member Licensed User May 22, 2017 #9 Erel said: Yes. HttpUtils: https://www.b4x.com/android/forum/t...oid-web-services-are-now-simple.9176/#content HttpUtils2: http://www.b4x.com/forum/basic4andr...web-services-now-even-simpler.html#post109068 If you are using HttpUtils then you should switch to HttpUtils2 or OkHttpUtils2. The API of HttpUtils2 and OkHttpUtils2 is the same. Click to expand... Thanks Upvote 0
Erel said: Yes. HttpUtils: https://www.b4x.com/android/forum/t...oid-web-services-are-now-simple.9176/#content HttpUtils2: http://www.b4x.com/forum/basic4andr...web-services-now-even-simpler.html#post109068 If you are using HttpUtils then you should switch to HttpUtils2 or OkHttpUtils2. The API of HttpUtils2 and OkHttpUtils2 is the same. Click to expand... Thanks
D devmobile Active Member Licensed User May 22, 2017 #10 Erel i need to DELETE method and other All method is working in my project But not send data over Method to server I see your src HTTPUTIL2 but it didnot help to me Upvote 0
Erel i need to DELETE method and other All method is working in my project But not send data over Method to server I see your src HTTPUTIL2 but it didnot help to me
Erel B4X founder Staff member Licensed User Longtime User May 22, 2017 #11 Are you using HttpUtils2 or HttpUtils? Upvote 0
D devmobile Active Member Licensed User May 22, 2017 #12 Erel said: Are you using HttpUtils2 or HttpUtils? Click to expand... I add content-type to header and solved Upvote 0
Erel said: Are you using HttpUtils2 or HttpUtils? Click to expand... I add content-type to header and solved