yapi_api 1.0.0
yapi_api: ^1.0.0 copied to clipboard
A Dart package for interacting with YApi server APIs. Provides easy-to-use methods to fetch interface and project data from YApi with proper authentication and error handling.
import 'package:yapi_api/yapi_api.dart';
void main() {
final YapiApiHelper apiHelper = YapiApiHelper();
apiHelper.baseUrl = 'http://yapi.example.com';
apiHelper.cookie = 'your_cookie_here';
apiHelper.getInterface(1).then((YapiInterfaceResponse? response) {
if (response != null) {
print('interface: ${response.data?.title}');
} else {
print('get interface failed ');
}
});
apiHelper.getProject(1).then((YapiProjectResponse? response) {
if (response != null) {
print('project : ${response.data?.name}');
} else {
print('get project failed ');
}
});
}