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: learn/getting-started/create-your-first-application.mdx
+16-18Lines changed: 16 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -214,7 +214,7 @@ With everything in place, now its time to create your first record for the `Dog`
214
214
215
215
With the automatic REST API generation you have a plethora of options for interacting with the `Dog` table. We'll keep it simple for now, but will explore everything this has to offer in later guides.
216
216
217
-
Create a `POST` request using the REST API port and the `/Dog/` endpoint (don't forget the trailing slash). Include a JSON body with the specified attributes except for `id`:
217
+
Create a `PUT` request using the REST API port and the path `/Dog/001`. Include a JSON body with the specified attributes except for `id`. The `001` in the URL will be used as the ID for this entry.
218
218
219
219
:::note
220
220
If you're using Fabric remember to replace the `localhost` with your cluster's URL
@@ -224,22 +224,23 @@ If you're using Fabric remember to replace the `localhost` with your cluster's U
If you see a 36-character ID returned, then the record was successfully created!
260
-
261
-
With Harper tables, the `POST` method automatically generates IDs for you. You can still specify IDs yourself using a `PUT` method, and we'll explore those details in a future guide.
259
+
If you see `204` status code, then the record was successfully created!
262
260
263
261
## Read a Record
264
262
265
-
Now, with the returned ID, create a `GET` request to the endpoint `/Dog/<id>`:
263
+
Now, with the returned ID, create a `GET` request to the endpoint `/Dog/001`:
@@ -290,15 +288,15 @@ You should see the record we just created returned as JSON:
290
288
"name": "Harper",
291
289
"breed": "Black Labrador / Chow Mix",
292
290
"age": 5,
293
-
"id": "<id>"
291
+
"id": "001"
294
292
}
295
293
```
296
294
297
295
## Query a Record
298
296
299
297
The REST API isn't just for basic CRUD operations. It can also be used to create search queries using URL query strings.
300
298
301
-
Start by creating another `GET` query, but this time do not include the `<id>` part. Make sure to include a trailing slash. Then, include a query string containing an attribute and a value such as `?age=5`.
299
+
Start by creating another `GET` query, but this time do not include the ID (`001`) part. Make sure to include a trailing slash. Then, include a query string containing an attribute and a value such as `?age=5`.
302
300
303
301
<Tabs groupId="http-client">
304
302
<TabItem value="curl">
@@ -327,7 +325,7 @@ Search queries return a list of records that match the specified conditions, in
327
325
"name": "Harper",
328
326
"breed": "Black Labrador / Chow Mix",
329
327
"age": 5,
330
-
"id": "<id>"
328
+
"id": "001"
331
329
}
332
330
]
333
331
```
@@ -348,7 +346,7 @@ Push-based deployments is powered by the Harper CLI and is where your the user w
348
346
349
347
For a true production application, Harper recommends using pull-based deployments so that you can deploy tagged versions of your application repository. But for development and experimentation, push-based is perfectly fine. Later guides will explore pull-based deployment workflows in more detail.
350
348
351
-
To get started with push-based deployments, open a command line and set the current directory to the application directory. Run the `harper deploy` command using the Fabric clusters URL, username, and password:
349
+
To get started with push-based deployments, open a command line and set the current directory to the application directory. Run the `harper deploy` command using the Fabric cluster's URL, username, and password:
0 commit comments