http.h 667 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright 2014-2023 The GmSSL Project. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the License); you may
  5. * not use this file except in compliance with the License.
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. */
  9. #ifndef GMSSL_HTTP_H
  10. #define GMSSL_HTTP_H
  11. #include <stdint.h>
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. int http_parse_uri(const char *uri, char host[128], int *port, char path[256]);
  16. int http_parse_response(char *buf, size_t buflen, uint8_t **content, size_t *contentlen, size_t *left);
  17. int http_get(const char *uri, uint8_t *buf, size_t *contentlen, size_t buflen);
  18. #ifdef __cplusplus
  19. }
  20. #endif
  21. #endif