.http files. This guide covers the import process and key differences.
Importing a Collection
Export your Postman collection as JSON (Collection v2.1), then import:What Gets Converted
| Postman Feature | hitspec Equivalent |
|---|---|
| Request method + URL | GET {{baseUrl}}/path |
| Headers | Headers below the request line |
| Body (raw JSON) | JSON body block |
| Body (form-urlencoded) | URL-encoded body |
| Folders | Request sections with ### separators |
Collection variables {{var}} | {{var}} (same syntax) |
Dynamic variables {{$guid}} | {{$uuid()}} |
Dynamic variables {{$timestamp}} | {{$timestamp()}} |
Dynamic variables {{$randomInt}} | {{$random(0, 1000)}} |
Dynamic variables {{$randomEmail}} | {{$randomEmail()}} |
Other Import Formats
hitspec also imports from:OpenAPI / Swagger
curl Commands
Insomnia
Key Differences from Postman
Test Syntax
- Postman (JavaScript)
- hitspec (declarative)
Variables
| Postman | hitspec |
|---|---|
| Collection variables | @variable = value in file |
| Environment variables | hitspec.yaml environments |
{{$guid}} | {{$uuid()}} |
pm.environment.set("key", val) | >>>capture blocks |
Authentication
| Postman | hitspec |
|---|---|
| Collection-level auth UI | # @auth bearer {{token}} per request |
| Inherit from parent | Explicit per request or default headers in config |
Request Dependencies
| Postman | hitspec |
|---|---|
| Execution order in Collection Runner | # @depends requestName |
pm.environment.set() for chaining | >>>capture blocks |
After Import
After importing, you should:- Add assertions — the import generates basic
expect status == 200assertions. Add more specific ones. - Replace hardcoded values — use variables and
{{$env()}}for URLs, tokens, etc. - Add captures — chain requests with
>>>captureblocks and@depends. - Set up environments — create
hitspec.yamlwith your environments.