agentic-x402 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-x402",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Agent skill for x402 payments - pay for and sell gated content",
5
5
  "type": "module",
6
6
  "bin": {
@@ -54,7 +54,9 @@ Examples:
54
54
  }
55
55
 
56
56
  try {
57
- const headers: Record<string, string> = {};
57
+ const headers: Record<string, string> = {
58
+ 'Accept': 'application/json',
59
+ };
58
60
 
59
61
  if (body) {
60
62
  headers['Content-Type'] = 'application/json';
@@ -59,7 +59,10 @@ Examples:
59
59
  const initialResponse = await fetch(url, {
60
60
  method,
61
61
  body: body ? body : undefined,
62
- headers: body ? { 'Content-Type': 'application/json' } : undefined,
62
+ headers: {
63
+ 'Accept': 'application/json',
64
+ ...(body ? { 'Content-Type': 'application/json' } : {}),
65
+ },
63
66
  });
64
67
 
65
68
  if (initialResponse.status !== 402) {
@@ -143,7 +146,10 @@ Examples:
143
146
  const response = await client.fetchWithPayment(url, {
144
147
  method,
145
148
  body: body ? body : undefined,
146
- headers: body ? { 'Content-Type': 'application/json' } : undefined,
149
+ headers: {
150
+ 'Accept': 'application/json',
151
+ ...(body ? { 'Content-Type': 'application/json' } : {}),
152
+ },
147
153
  });
148
154
 
149
155
  if (!response.ok) {