Skip to content

Commit

Permalink
Release changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric05 authored Dec 30, 2024
1 parent 02fdbd8 commit 0cd9984
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
11 changes: 11 additions & 0 deletions blog/2024-12-30-dothttp-extensions-1.0.38 - 1.0.39.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: dothttp-runner 1.0.38 - 1.0.39 Release Notes
author: Prasanth
author_url: https://github.com/cedric05
tags: [dothttp-runner, vscode]
description: Updates on the latest extension releases.
hide_table_of_contents: false
---

## 1.0.39 / 1.0.38
- Add support variable syntax in http instead of providing in comments
20 changes: 13 additions & 7 deletions docs/varibles.md → docs/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ slug: variables

## Variables

one can define variables in http file via `{{var}}`. define it once and use it everywhere
one can define variables in http file via `var name = "some value"`. define it once and use it everywhere

#### example 1:

```shell
var name = "get";
//test.http
GET https://httpbin.org/{{var=get}}
GET https://httpbin.org/{{name}}
? path = "{{var}}"
// curl -X GET 'https://httpbin.org/get?path=get'
```
Expand Down Expand Up @@ -116,12 +117,14 @@ using $randomStr will generate random string of random length.
- random bool ( $randomBool)

```http
var name = randomStr(10);
var height = randomInt(2);
//test.http
POST https://httpbin.org/post
json({
"full name": "john {{name=$randomStr:10}}",
"full name": "john {{name}}",
"name": "john {{name}}",
"height": {{$randomInt:2}},
"height": {{height}},
})
```
name --> shiva + "randomString of length 10 chars"
Expand All @@ -145,11 +148,12 @@ uuid is completely random string with 36 char length
#### Example

```http
var uuid = uuid();
POST "https://httpbin.org/post"
json(
{
// generates random uuid
"uuid": "{{$uuid}}"
"uuid": "{{uuid}}"
}
)
Expand All @@ -168,11 +172,12 @@ we’ll see random, human-readable slugs (e.g., brave-purple-penguin) in the web
#### example

```http
var slug = randomSlug();
POST "https://httpbin.org/post"
json(
{
// creates slug with human readable random
"slug": "{{$randomSlug:10}}"
"slug": "{{slug}}"
}
)
Expand All @@ -188,11 +193,12 @@ usage:

#### Example:
```http
var currentTime = timestamp();
POST "https://httpbin.org/post"
json(
{
// creates current timestamp
"timestamp": "{{$timestamp}}"
"timestamp": "{{currentTime}}"
}
)
Expand Down

0 comments on commit 0cd9984

Please sign in to comment.