Cython buildable (Python Binded) C code to download file via HTTP (REST API)

早过忘川 提交于 2020-01-16 11:32:08

问题


I have been googling and searching some good example(s) and so far somewhat closest was this one: Architecting a RESTFul C++ api to interface with Python

In a nutshell: Essentially, I am building .so files using cython (via building Python Extension module with Bindings from *.c source file).

Scope/Requierments:

  • As first prio - I need to add codebase in *.c file that lets to download an file from certain endpoint (lets say some cloud storage) and as bonus would be able to communicate with REST APIs as well ( so kind of libcurl integration is lurking in my imagination ). Important aspect is that C code must be Python Binded so I/ produced *.so or *.dll library can communicate from Python and to Python.
  • As per next requierment (second prio) - to load any similar DLL or SO library at runtime ( dynamically ), I have not yet found good example, so that would also be great. But that is sepeprate question.

What I have tried:

  • pure C code, that uses net/http header, simillary to one I use in my Java project, yet that is failing in compilation.

Therefore - questions is:

  • how to achieve first prio and is there an example or at least clear guide how to add compatible code in *.c file to achieve this functionality?

来源:https://stackoverflow.com/questions/58920364/cython-buildable-python-binded-c-code-to-download-file-via-http-rest-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!