Question about HttpUtils2

CharlesIPTI

Active Member
Licensed User
Longtime User
regarding HttpUtils2 - Web services are now even simpler

How to use
- Dim a HttpJob object
- Initialize the Job and set the module that will handle the JobDone event.
The JobDone event is raised when a job completes.
The module can be an Activity, Service or class instance. You can use the Me keyword to reference the current module.
Note that CallSubDelayed is used to call the event.


So based upon that I tried a service ...
Anything to get all of these extra subs out of my main activity right..

Compiling code. Error
Error compiling program.
Error description: Me keyword can only be used inside Class modules.
Occurred on line: 36
job1.Initialize("Job1", Me)
Word: me
 
Last edited:

CharlesIPTI

Active Member
Licensed User
Longtime User
Versioning

Can I have 2.0 then please


B4X:
Sub JobDone (Job As HttpJob)

    Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
    If Job.Success = True Then
      
        Select Job.JobName           
                  Case "Job1"
                     GetCartStateParser.Initialize                                                                     
                        InputStream = HttpUtils.GetInputStream(PostGetCartState)                                 
                           If InputStream.BytesAvailable > 0 Then
                                    GetCartStateParser.Parse(InputStream, "GetCartStateParse")
                           End If 
            Case "Job3"                
                'Activity.SetBackgroundImage(Job.GetBitmap)
       
            End Select
    Else
        Log("Error: " & Job.ErrorMessage)
        ToastMessageShow("Error: " & Job.ErrorMessage, True)
    End If
            
    Job.Release
            
End Sub


Compiling code. Error
Error compiling program.
Error description: Unknown member: bytesavailable
Occurred on line: 51
If InputStream.BytesAvailable > 0 Then
Word: bytesavailable
 
Upvote 0

CharlesIPTI

Active Member
Licensed User
Longtime User
2.01

I am now Running Version 2.01


Compiling code. Error
Error compiling program.
Error description: Unknown member: bytesavailable
Occurred on line: 49
If InputStream.BytesAvailable > 0 Then
Word: bytesavailable

B4X:
Sub JobDone (Job As HttpJob)

    Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
    If Job.Success = True Then
      
        Select Job.JobName           
                  Case "Job1"
                     GetCartStateParser.Initialize                                                                     
                        InputStream = HttpUtils.GetInputStream(PostGetCartState)                                 
                           If InputStream.BytesAvailable > 0 Then
                                    GetCartStateParser.Parse(InputStream, "GetCartStateParse")
                           End If
 
Upvote 0

pluton

Active Member
Licensed User
Longtime User
The subject of this thread is very misleading. It is similar to Erel's tutorial thread.
Can the subject be changed and the OP make SURE that his subjects actually reflect his problem so searching the forum becomes easier.

+1
Title is same as Erel tutorial. Please change title of this topis or put just [Problem] HttpUtils2
 
Upvote 0

Kevin

Well-Known Member
Licensed User
Longtime User
When did 2.01 come out? I guess I need to check my download again...

Copy the URL sent in the email about 2.0 then replace b4a-full.exe at the end of the URL with beta.exe and use the same username & password contained in the email.

I think he said 2.02 would be released soon.
 
Upvote 0
Top