Skip to content

Commit f818591

Browse files
Updated to work with Post requests
1 parent a7dceaf commit f818591

File tree

4,906 files changed

+229089
-248798
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,906 files changed

+229089
-248798
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## [0.0.8]
2+
* Fixed a bug where POST reuqest could not handle nested JSON data
3+
14
## [0.0.7]
25
* Fixed a bug for https websites where consumer_key and consumer_secret params are fixed
36

README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ class _MyHomePageState extends State<MyHomePage> {
4343
4444
/// Initialize the API
4545
WooCommerceAPI wc_api = new WooCommerceAPI(
46-
"http://samarth.todaylivedeal.com",
47-
"ck_2b548f9652a3468f67bbc5bdb04e48edf270a000",
48-
"cs_fa349f1ba49b519ba9493eb2b64c88781b286b52"
46+
"https://www.yourwebsite.com",
47+
"ck_your_consumer_key",
48+
"cs_your_consumer_secret"
4949
);
5050
5151
/// Get data using the endpoint
@@ -98,5 +98,27 @@ class _MyHomePageState extends State<MyHomePage> {
9898
}
9999
100100
```
101+
102+
### Example of making a POST (Create a customer)
103+
```
104+
Future createCustomer() async {
105+
try {
106+
var response = await wooCommerceAPI.postAsync(
107+
"customers",
108+
{
109+
"email": 's@c.com',
110+
"password": "123",
111+
"billing": {
112+
"first_name": "Samarth",
113+
}
114+
},
115+
);
116+
print(response); // JSON Object with response
117+
} catch (e) {
118+
print(e);
119+
}
120+
}
121+
```
122+
101123
### Report any issues if you face any or drop me an email at samarthagarwal@live.com
102124

doc/api/__404error.html

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no">
7+
<meta name="generator" content="made with love by dartdoc 0.28.1+2">
8+
<meta name="description" content="woocommerce_api API docs, for the Dart programming language.">
9+
<title>woocommerce_api - Dart API docs</title>
10+
11+
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500,400i,400,300|Source+Sans+Pro:400,300,700" rel="stylesheet">
12+
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
13+
<link rel="stylesheet" href="static-assets/github.css">
14+
<link rel="stylesheet" href="static-assets/styles.css">
15+
<link rel="icon" href="static-assets/favicon.png">
16+
17+
</head>
18+
19+
<body>
20+
21+
<div id="overlay-under-drawer"></div>
22+
23+
<header id="title">
24+
<button id="sidenav-left-toggle" type="button">&nbsp;</button>
25+
<ol class="breadcrumbs gt-separated dark hidden-xs">
26+
<li><a href="https://github.com/samarthagarwal/woocommerce_dart">woocommerce_api package</a></li>
27+
</ol>
28+
<div class="self-name">woocommerce_api</div>
29+
<form class="search navbar-right" role="search">
30+
<input type="text" id="search-box" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
31+
</form>
32+
</header>
33+
34+
<main>
35+
36+
<div id="dartdoc-sidebar-left" class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
37+
<header id="header-search-sidebar" class="hidden-l">
38+
<form class="search-sidebar" role="search">
39+
<input type="text" id="search-sidebar" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
40+
</form>
41+
</header>
42+
43+
<ol class="breadcrumbs gt-separated dark hidden-l" id="sidebar-nav">
44+
<li><a href="https://github.com/samarthagarwal/woocommerce_dart">woocommerce_api package</a></li>
45+
</ol>
46+
47+
<h5><span class="package-name">woocommerce_api</span> <span class="package-kind">package</span></h5>
48+
<ol>
49+
<li class="section-title">Libraries</li>
50+
<li><a href="query_string/query_string-library.html">query_string</a></li>
51+
<li><a href="woocommerce_api/woocommerce_api-library.html">woocommerce_api</a></li>
52+
<li class="section-title">Dart</li>
53+
<li><a href="dart-ui/dart-ui-library.html">dart:ui</a></li>
54+
<li class="section-subtitle">Core</li>
55+
<li class="section-subitem"><a href="dart-async/dart-async-library.html">dart:async</a></li>
56+
<li class="section-subitem"><a href="dart-collection/dart-collection-library.html">dart:collection</a></li>
57+
<li class="section-subitem"><a href="dart-convert/dart-convert-library.html">dart:convert</a></li>
58+
<li class="section-subitem"><a href="dart-core/dart-core-library.html">dart:core</a></li>
59+
<li class="section-subitem"><a href="dart-developer/dart-developer-library.html">dart:developer</a></li>
60+
<li class="section-subitem"><a href="dart-math/dart-math-library.html">dart:math</a></li>
61+
<li class="section-subitem"><a href="dart-typed_data/dart-typed_data-library.html">dart:typed_data</a></li>
62+
<li class="section-subtitle">VM</li>
63+
<li class="section-subitem"><a href="dart-io/dart-io-library.html">dart:io</a></li>
64+
<li class="section-subitem"><a href="dart-isolate/dart-isolate-library.html">dart:isolate</a></li>
65+
</ol>
66+
</div>
67+
68+
<div id="dartdoc-main-content" class="col-xs-12 col-sm-9 col-md-8 main-content">
69+
<h1>404: Something's gone wrong :-(</h1>
70+
71+
<section class="desc">
72+
<p>You've tried to visit a page that doesn't exist. Luckily this site
73+
has other <a href="index.html">pages</a>.</p>
74+
<p>If you were looking for something specific, try searching:
75+
<form class="search-body" role="search">
76+
<input type="text" id="search-body" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
77+
</form>
78+
</p>
79+
80+
</section>
81+
</div> <!-- /.main-content -->
82+
83+
<div id="dartdoc-sidebar-right" class="col-xs-6 col-sm-6 col-md-2 sidebar sidebar-offcanvas-right">
84+
</div>
85+
86+
</main>
87+
88+
<footer>
89+
<span class="no-break">
90+
woocommerce_api 0.0.8
91+
</span>
92+
93+
94+
</footer>
95+
96+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
97+
<script src="static-assets/typeahead.bundle.min.js"></script>
98+
<script src="static-assets/highlight.pack.js"></script>
99+
<script src="static-assets/URI.js"></script>
100+
<script src="static-assets/script.js"></script>
101+
102+
103+
</body>
104+
105+
</html>

doc/api/categories.json

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
[
2+
{
3+
"name": "dart:async",
4+
"qualifiedName": "dart:async",
5+
"href": "dart-async/dart-async-library.html",
6+
"type": "library",
7+
"categories": [
8+
"Core"
9+
]
10+
},
11+
{
12+
"name": "dart:collection",
13+
"qualifiedName": "dart:collection",
14+
"href": "dart-collection/dart-collection-library.html",
15+
"type": "library",
16+
"categories": [
17+
"Core"
18+
]
19+
},
20+
{
21+
"name": "dart:convert",
22+
"qualifiedName": "dart:convert",
23+
"href": "dart-convert/dart-convert-library.html",
24+
"type": "library",
25+
"categories": [
26+
"Core"
27+
]
28+
},
29+
{
30+
"name": "dart:core",
31+
"qualifiedName": "dart:core",
32+
"href": "dart-core/dart-core-library.html",
33+
"type": "library",
34+
"categories": [
35+
"Core"
36+
]
37+
},
38+
{
39+
"name": "dart:developer",
40+
"qualifiedName": "dart:developer",
41+
"href": "dart-developer/dart-developer-library.html",
42+
"type": "library",
43+
"categories": [
44+
"Core"
45+
]
46+
},
47+
{
48+
"name": "dart:io",
49+
"qualifiedName": "dart:io",
50+
"href": "dart-io/dart-io-library.html",
51+
"type": "library",
52+
"categories": [
53+
"VM"
54+
]
55+
},
56+
{
57+
"name": "dart:isolate",
58+
"qualifiedName": "dart:isolate",
59+
"href": "dart-isolate/dart-isolate-library.html",
60+
"type": "library",
61+
"categories": [
62+
"VM"
63+
]
64+
},
65+
{
66+
"name": "dart:math",
67+
"qualifiedName": "dart:math",
68+
"href": "dart-math/dart-math-library.html",
69+
"type": "library",
70+
"categories": [
71+
"Core"
72+
]
73+
},
74+
{
75+
"name": "dart:typed_data",
76+
"qualifiedName": "dart:typed_data",
77+
"href": "dart-typed_data/dart-typed_data-library.html",
78+
"type": "library",
79+
"categories": [
80+
"Core"
81+
]
82+
}
83+
]

0 commit comments

Comments
 (0)