models.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:pyfc4 作者: ghukill 项目源码 文件源码
def copy(self, destination):

        '''
        Method to copy resource to another location

        Args:
            destination (rdflib.term.URIRef, str): URI location to move resource

        Returns:
            (Resource) new, moved instance of resource
        '''

        # set move headers
        destination_uri = self.repo.parse_uri(destination)

        # http request
        response = self.repo.api.http_request('COPY', self.uri, data=None, headers={'Destination':destination_uri.toPython()})

        # handle response
        if response.status_code == 201:
            return destination_uri
        else:
            raise Exception('HTTP %s, could not move resource %s to %s' % (response.status_code, self.uri, destination_uri))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号