You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix HTTParty content type for nil request bodies (#536)
- Default POST, PUT, PATCH, DELETE payload to {} when request_body is nil
to ensure Content-Type: application/json is sent
- Add request_body support to DELETE (e.g. cancellation_reason for bookings)
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Changelog
2
2
3
+
### Unreleased
4
+
* Fixed HTTParty content type issue when request body is nil - POST, PUT, PATCH, and DELETE now default to empty object to ensure Content-Type: application/json is sent (#536)
5
+
* Added support for request_body parameter on DELETE (e.g. cancellation_reason for bookings) (#536)
│ └── content_type_fix_example.rb # Verifies POST/DELETE with no body send Content-Type
10
12
├── events/ # Event-related examples
11
13
│ └── event_notetaker_example.rb # Example of creating events with Notetaker
12
14
├── messages/ # Message-related examples
@@ -38,6 +40,18 @@ Before running any example, make sure to:
38
40
39
41
## Available Examples
40
42
43
+
### HTTParty Content-Type Fix
44
+
-`httparty_content_type_fix/content_type_fix_example.rb`: Verifies the fix for POST/PUT/PATCH/DELETE requests that previously failed with 422 when no body was provided (HTTParty migration in v6.5.0). Demonstrates:
45
+
- Auth#detect_provider (POST with query params only)
46
+
- Auth#revoke (POST with query params only)
47
+
- Drafts#send (POST with no body)
48
+
- Bookings#destroy (DELETE with optional cancellation_reason)
49
+
50
+
Run all: `ruby examples/httparty_content_type_fix/content_type_fix_example.rb`
51
+
Run one: `ruby examples/httparty_content_type_fix/content_type_fix_example.rb detect_provider`
52
+
53
+
Environment variables: NYLAS_API_KEY (required), NYLAS_EMAIL (for detect_provider), NYLAS_GRANT_ID and NYLAS_TEST_EMAIL (for drafts_send), NYLAS_ACCESS_TOKEN (for revoke), NYLAS_BOOKING_ID and NYLAS_CONFIGURATION_ID (for bookings).
54
+
41
55
### Events
42
56
-`events/event_notetaker_example.rb`: Demonstrates how to create calendar events with Notetaker integration, including:
0 commit comments