Import .http or .rest files
From a .http / .rest file
Section titled “From a .http / .rest file”Select .http / .rest file in Import collection, click Import, and choose the file. Kurlo reads the format shared by the JetBrains HTTP Client and the VS Code REST Client:
@baseUrl = https://api.example.com
### List ordersGET {{baseUrl}}/orders?status=openAccept: application/json
### Create order# @name createOrderPOST {{baseUrl}}/ordersContent-Type: application/json
{ "sku": "KURLO-1" }###separates requests, and the text after it becomes the request name. A# @namedirective takes priority.- File variables (
@baseUrl = …) become collection variables, so{{baseUrl}}keeps resolving after import. - A bare URL line is treated as
GET, and a trailingHTTP/1.1is ignored. WEBSOCKETrequests and theX-REQUEST-TYPE: GraphQLheader map to Kurlo’s WebSocket and GraphQL request types.- JetBrains pre-request scripts (
< {% … %}above the request line) and response handlers (> {% … %}after the body) become the request’s pre-request and post-response scripts. They keep running as written: Kurlo’s script sandbox understands the JetBrainsclient,requestandresponseobjects (see JetBrains HTTP Client globals). < ./body.json,> ./handler.jsand>> ./out.jsonreference files the importer cannot read. Kurlo records them in the request’s Docs tab instead of dropping them silently.
You can also drop a .http or .rest file anywhere in the Kurlo window to import it.
Was this page helpful?