service.py 文件源码

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

项目:GAMADV-X 作者: taers232c 项目源码 文件源码
def Put(self, data, uri, extra_headers=None, url_params=None, 
           escape_params=True, content_type='application/atom+xml; charset=UTF-8'):
    """Updates an entry at the given URI.

    Args:
      data: string, ElementTree._Element, or xml_wrapper.ElementWrapper The 
            XML containing the updated data.
      uri: string A URI indicating entry to which the update will be applied.
           Example: '/base/feeds/items/ITEM-ID'
      extra_headers: dict (optional) HTTP headers which are to be included.
                     The client automatically sets the Content-Type,
                     Authorization, and Content-Length headers.
      url_params: dict (optional) Additional URL parameters to be included
                  in the URI. These are translated into query arguments
                  in the form '&dict_key=value&...'.
                  Example: {'max-results': '250'} becomes &max-results=250
      escape_params: boolean (optional) If false, the calling code has already
                     ensured that the query will form a valid URL (all
                     reserved characters have been escaped). If true, this
                     method will escape the query and any URL parameters
                     provided.

    Returns:
      httplib.HTTPResponse Server's response to the PUT request.
    """
    if extra_headers is None:
      extra_headers = {}
    if content_type:
      extra_headers['Content-Type'] = content_type
    return self.request('PUT', uri, data=data, headers=extra_headers, 
                        url_params=url_params)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号