Skip to content

Commit

Permalink
Merge PR #48 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by etobella
  • Loading branch information
OCA-git-bot committed Nov 25, 2024
2 parents b03a7ea + 85cf5c0 commit a71ddcb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion webservice/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ WebService

|badge1| |badge2| |badge3| |badge4| |badge5|

This module creates WebService frameworks to be used globally
This module creates WebService frameworks to be used globally.

The module introduces support for HTTP Request protocol. The webservice HTTP call returns by default the content of the response. A context 'content_only' can be passed to get the full response object.

**Table of contents**

Expand Down
5 changes: 4 additions & 1 deletion webservice/components/request_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class BaseRestRequestsAdapter(Component):
# TODO: url and url_params could come from work_ctx
def _request(self, method, url=None, url_params=None, **kwargs):
url = self._get_url(url=url, url_params=url_params)
content_only = kwargs.pop("content_only", True)
new_kwargs = kwargs.copy()
new_kwargs.update(
{
Expand All @@ -35,7 +36,9 @@ def _request(self, method, url=None, url_params=None, **kwargs):
# pylint: disable=E8106
request = requests.request(method, url, **new_kwargs)
request.raise_for_status()
return request.content
if content_only:
return request.content
return request

def get(self, **kwargs):
return self._request("get", **kwargs)
Expand Down
4 changes: 3 additions & 1 deletion webservice/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
This module creates WebService frameworks to be used globally
This module creates WebService frameworks to be used globally.

The module introduces support for HTTP Request protocol. The webservice HTTP call returns by default the content of the response. A context 'content_only' can be passed to get the full response object.
3 changes: 2 additions & 1 deletion webservice/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@ <h1 class="title">WebService</h1>
!! source digest: sha256:44ac7b2e56db131da94f2a4ed85bb452eae8657d761490ffa97b08b268d6f9fe
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/web-api/tree/16.0/webservice"><img alt="OCA/web-api" src="https://img.shields.io/badge/github-OCA%2Fweb--api-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/web-api-16-0/web-api-16-0-webservice"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/web-api&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module creates WebService frameworks to be used globally</p>
<p>This module creates WebService frameworks to be used globally.</p>
<p>The module introduces support for HTTP Request protocol. The webservice HTTP call returns by default the content of the response. A context ‘content_only’ can be passed to get the full response object.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand Down

0 comments on commit a71ddcb

Please sign in to comment.