pjetson Member Licensed User Longtime User Mar 2, 2017 #1 I am aware of the thread from a few months back on this subject, but the forum tips advise me to start a new thread. I also need HTTP DELETE, but I'm unfortunately not as clever as the other posters in that thread and I need a little more guidance. I've downloaded the source code from the link that Erel posted. I unzipped the file and found two files with the name HttpJob.bas that (with a brief examination) appear to be the same. Which one of these two files do I need to modify? I found this code, which I presume is the HttpJob.Download sub referred to: Code: Copy Public Sub Download(Link As String) req.InitializeGet(Link) CallSubDelayed2(HttpUtils2Service, "SubmitJob", Me) End Sub From Erel's post, it seems that I need to add a new sub using code like this: Code: Copy Public Sub Delete(Link As String) req.InitializeDelete(Link) CallSubDelayed2(HttpUtils2Service, "SubmitJob", Me) End Sub But then what do I do exactly? I suspect that I have to compile the modified HttpJob.bas file into a library, and then replace the existing library, but the HttpJob.bas file doesn't seem to have the right file name. Thanks, Peter
I am aware of the thread from a few months back on this subject, but the forum tips advise me to start a new thread. I also need HTTP DELETE, but I'm unfortunately not as clever as the other posters in that thread and I need a little more guidance. I've downloaded the source code from the link that Erel posted. I unzipped the file and found two files with the name HttpJob.bas that (with a brief examination) appear to be the same. Which one of these two files do I need to modify? I found this code, which I presume is the HttpJob.Download sub referred to: Code: Copy Public Sub Download(Link As String) req.InitializeGet(Link) CallSubDelayed2(HttpUtils2Service, "SubmitJob", Me) End Sub From Erel's post, it seems that I need to add a new sub using code like this: Code: Copy Public Sub Delete(Link As String) req.InitializeDelete(Link) CallSubDelayed2(HttpUtils2Service, "SubmitJob", Me) End Sub But then what do I do exactly? I suspect that I have to compile the modified HttpJob.bas file into a library, and then replace the existing library, but the HttpJob.bas file doesn't seem to have the right file name. Thanks, Peter
DonManfred Expert Licensed User Longtime User Mar 2, 2017 #2 Download the src zip from the okhttputils thread and extract the files. Open this project and do the chnges here. Add the sub to the HttpJob module from the project. Compile the project as library. The lines Code: Copy #LibraryVersion: 2.20 #LibraryName: OkHttpUtils2 # in the main module set the name and version of the resulting library. At the end you now have a new okhttputils2 library... Give it another name if you prefer. Upvote 0
Download the src zip from the okhttputils thread and extract the files. Open this project and do the chnges here. Add the sub to the HttpJob module from the project. Compile the project as library. The lines Code: Copy #LibraryVersion: 2.20 #LibraryName: OkHttpUtils2 # in the main module set the name and version of the resulting library. At the end you now have a new okhttputils2 library... Give it another name if you prefer.
Erel B4X founder Staff member Licensed User Longtime User Mar 2, 2017 #3 Another option is to just use the two modules instead of the library. Upvote 0
pjetson Member Licensed User Longtime User Mar 2, 2017 #4 Thanks, Don. I get three error messages when I "compile to library", but two of them seem straightforward and I think I have dealt with them properly. One of the errors is that the JavaObject library is included but not used, and the other asked me to remove a line from the manifest.xml file. The third error message has me worried, though - it says "File 'httpjob.bas' is not used. (warning #15)". Since httpjob.bas is the file I've added the HttpJob.Download sub to, isn't that a problem? Erel, what do you mean by "just use the two modules instead of the library"? Peter Upvote 0
Thanks, Don. I get three error messages when I "compile to library", but two of them seem straightforward and I think I have dealt with them properly. One of the errors is that the JavaObject library is included but not used, and the other asked me to remove a line from the manifest.xml file. The third error message has me worried, though - it says "File 'httpjob.bas' is not used. (warning #15)". Since httpjob.bas is the file I've added the HttpJob.Download sub to, isn't that a problem? Erel, what do you mean by "just use the two modules instead of the library"? Peter
Erel B4X founder Staff member Licensed User Longtime User Mar 5, 2017 #5 You don't need to compile it into a library. You can instead add the two code module to your project. Upvote 0
You don't need to compile it into a library. You can instead add the two code module to your project.
lucad Member Licensed User Longtime User Mar 14, 2017 #6 This worked for me Code: Copy Public Sub Delete(Link As String) Dim job_cancella_item As HttpJob job_cancella_item.Initialize("job_cancella_item",Me) job_cancella_item.PostString(Link,"") job_cancella_item.GetRequest.InitializeDelete(Link) End Sub Upvote 0
This worked for me Code: Copy Public Sub Delete(Link As String) Dim job_cancella_item As HttpJob job_cancella_item.Initialize("job_cancella_item",Me) job_cancella_item.PostString(Link,"") job_cancella_item.GetRequest.InitializeDelete(Link) End Sub