Skip to content

Commit 0d91db6

Browse files
committed
Document build_field_request
It is public and its two surprises are worth stating: the method defaults to POST, and an empty fields mapping still asks for a JSON content type while sending no body, which is what an action taking no arguments needs.
1 parent e5c22b0 commit 0d91db6

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

  • src/palace/manager/integration/license/overdrive

‎src/palace/manager/integration/license/overdrive/model.py‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,17 @@ def build_field_request(
228228
*,
229229
method: str = "POST",
230230
) -> RequestSpec:
231-
"""Describe a request whose body is an Overdrive "fields" document."""
231+
"""Describe a request whose body is an Overdrive "fields" document.
232+
233+
:param url: The URL to request.
234+
:param fields: The field names and values to send. An empty mapping
235+
produces a request with no body, though still with the JSON content
236+
type, which is what an action taking no arguments needs.
237+
:param method: The HTTP method, defaulting to POST because that is what
238+
every Overdrive action that carries fields uses.
239+
240+
:return: The request to make.
241+
"""
232242
if fields:
233243
data = json.dumps(
234244
{

0 commit comments

Comments
 (0)