Robocorp HTTP库
项目描述
robocorp-http
我们将弃用robocorp-http
库,并建议直接使用requests库。
requests
库的使用非常广泛,几乎任何AI/LLM都能够提供所需的代码,因此我们不需要额外的包装。
import requests
def download_file(url, local_filename):
response = requests.get(url)
response.raise_for_status() # this will raise an exception if the request fails
with open(local_filename, 'wb') as stream:
stream.write(response.content) # write the content of the response to a file
return local_filename
注意:requests库已包含在robocorp包中。
有关更多信息,请参阅我们的Requests第三方库文档。