File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,34 @@ var client = xmlrpc.createClient('YOUR_ENDPOINT');
170
170
client .methodCall (' YOUR_METHOD' , [new YourType (yourVariable)], yourCallback);
171
171
```
172
172
173
+ ### To Debug (client-side)
174
+
175
+ Error callbacks on the client are enriched with request and response
176
+ information and the returned body as long as a http connection was made,
177
+ to aide with request debugging. Example:
178
+
179
+ ``` javascript
180
+ var client = xmlrpc .createClient ({ host: ' example.com' , port: 80 });
181
+ client .methodCall (' FAULTY_METHOD' , [], function (error , value ) {
182
+ if (error) {
183
+ console .log (' error:' , error);
184
+ console .log (' req headers:' , error .req && error .req ._header );
185
+ console .log (' res code:' , error .res && error .res .statusCode );
186
+ console .log (' res body:' , error .body );
187
+ } else {
188
+ console .log (' value:' , value);
189
+ }
190
+ });
191
+
192
+ // error: [Error: Unknown XML-RPC tag 'TITLE']
193
+ // req headers: POST / HTTP/1.1
194
+ // User-Agent: NodeJS XML-RPC Client
195
+ // ...
196
+ // res code: 200
197
+ // res body: <!doctype html>
198
+ // ...
199
+ ```
200
+
173
201
### To Test
174
202
175
203
[ ![ Build
You can’t perform that action at this time.
0 commit comments