Subversion Repositories Kolibri OS


Rev 4221 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  2. get(*url);
  3.         *url = pointer to ASCIIZ URL
  4. Initiates a HTTP connection, using 'GET' method.
  5.  - returns 0 on error, identifier otherwise.
  7. head(*url);
  8.         *url = pointer to ASCIIZ URL
  9. Initiate a HTTP connection, using 'HEAD' method.
  10.  - returns 0 on error, identifier otherwise
  12. post(*url, *content-type, content-length);
  13.         *url = pointer to ASCIIZ URL
  14.         *content-type = pointer to ASCIIZ string containing content type.
  15.         content-length = length of the content (in bytes).
  16. Initiate a HTTP connection, using 'POST' method.
  17. The content itself must be send to the socket (which you can find in the structure),
  18. using system function 75, 6.
  19.  - returns 0 on error, identifier otherwise
  21. process(identifier);
  22.         identifier = identifier which one of the previous functions returned
  23. This procedure will handle all incoming data for a connection and place it in the buffer.
  24. As long as the procedure expects more data, -1 is returned and the procedure must be called again.
  25.  - When transfer is done, the procedure will return 0.
  27. All data is placed together with some flags and other attributes in the http_msg structure.
  28. This structure is defined in (and not copied here because it might still change.)
  29. The identifier used by the functions is actually a pointer to this structure.
  30. In the dword named .flags, the library will set various bit-flags indicating the status of the process.
  31. (When a transfer is done, one should check these bit-flags to find out if the transfer was error-free.)
  32. All received data is placed at the end of this structure, including HTTP headers.
  33. The dword .status contains the status code received from the server (e.g. 200 for OK).
  34. In header_length you'll find the length of the header as soon as it has been received.
  35. In content_length you'll find the length of the content (not counting headers).
  36. In content_received, you'll find the number of bytes already received (not counting headers).