2
0

a_http.inc 742 B

123456789101112131415161718192021222324
  1. /* SA-MP threaded HTTP/1.0 client for pawn
  2. *
  3. * (c) Copyright 2010, SA-MP Team
  4. *
  5. */
  6. // HTTP requests
  7. #define HTTP_GET 1
  8. #define HTTP_POST 2
  9. #define HTTP_HEAD 3
  10. // HTTP error response codes
  11. // These codes compliment ordinary HTTP response codes returned in 'response_code'
  12. // (10x) (20x OK) (30x Moved) (40x Unauthorised) (50x Server Error)
  13. #define HTTP_ERROR_BAD_HOST 1
  14. #define HTTP_ERROR_NO_SOCKET 2
  15. #define HTTP_ERROR_CANT_CONNECT 3
  16. #define HTTP_ERROR_CANT_WRITE 4
  17. #define HTTP_ERROR_CONTENT_TOO_BIG 5
  18. #define HTTP_ERROR_MALFORMED_RESPONSE 6
  19. native HTTP(index, type, url[], data[], callback[]);
  20. // example HTTP callback: public MyHttpResponse(index, response_code, data[]) { ... }