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
Copy file name to clipboardexpand all lines: lib/src/common/github.dart
+42
Original file line number
Diff line number
Diff line change
@@ -211,6 +211,48 @@ class GitHub {
211
211
preview: preview,
212
212
);
213
213
214
+
/// Handles PUT Requests that respond with JSON
215
+
///
216
+
/// [path] can either be a path like '/repos' or a full url.
217
+
/// [statusCode] is the expected status code. If it is null, it is ignored.
218
+
/// If the status code that the response returns is not the status code you provide
219
+
/// then the [fail] function will be called with the HTTP Response.
220
+
///
221
+
/// If you don't throw an error or break out somehow, it will go into some error checking
222
+
/// that throws exceptions when it finds a 404 or 401. If it doesn't find a general HTTP Status Code
223
+
/// for errors, it throws an Unknown Error.
224
+
///
225
+
/// [headers] are HTTP Headers. If it doesn't exist, the 'Accept' and 'Authorization' headers are added.
226
+
/// [params] are query string parameters.
227
+
/// [convert] is a simple function that is passed this [GitHub] instance and a JSON object.
228
+
///
229
+
/// The future will pass the object returned from this function to the then method.
230
+
/// The default [convert] function returns the input object.
231
+
/// [body] is the data to send to the server. Pass in a List<int> if you want to post binary body data. Everything else will have .toString() called on it and set as text content
232
+
/// [S] represents the input type.
233
+
/// [T] represents the type return from this function after conversion
0 commit comments