Subversion Repositories Kolibri OS

Rev

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

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