1# Copyright (c) 2022 Nordic Semiconductor ASA
2#
3# SPDX-License-Identifier: Apache-2.0
4
5import requests
6
7from west import log
8
9from fetchers.core import ZephyrBlobFetcher
10
11class HTTPFetcher(ZephyrBlobFetcher):
12
13    @classmethod
14    def schemes(cls):
15        return ['http', 'https']
16
17    def fetch(self, url, path):
18        log.dbg(f'HTTPFetcher fetching {url} to {path}')
19        resp = requests.get(url)
20        open(path, "wb").write(resp.content)
21