1 // The HTTP class for the MIDletPascal
5 public class H
6 {
11 // open a http connection
13 {
14 try
15 {
19 }
21 {
24 }
25 }
27 // return true if the connection is open
29 {
33 }
35 // close the connection
37 {
38 try
39 {
41 {
44 }
46 {
49 }
52 }
54 {
56 }
57 }
59 // add http header
61 {
62 try
63 {
65 }
67 {}
68 }
70 // setRequestMethod :
71 // HEAD, POST, GET bi trebalo rijesiti kao string konstante
73 {
74 try
75 {
77 }
79 {}
80 }
82 // get header field
84 {
85 try
86 {
87 String value;
94 }
96 {
98 }
99 }
101 // set message text
103 {
104 try
105 {
109 }
111 {
114 }
115 }
117 // getresponse code
118 // ovaj takodjer otvara konekciju i ceka dok se ne odgovori
120 {
121 try
122 {
127 }
129 {
131 }
132 }
134 // read the input data from the connection
136 {
137 try
138 {
143 {
145 }
148 }
150 {
152 }
153 }
155 };