vscode-restclient
vscode-restclient copied to clipboard
I need to escape variable interpolation
I have a post body that looks like
{ text: "this is my {{NotVariable}}" }
Rest client is showing error "Cannot convert undefined or null to object" because it looking for variable 'NotVariable' However I just want to send {{NotVariable}} instead interpolating this to a variable
How to do fix this behavior?
@ndinev in my test it works, could you please paste the complete request?
I'm having the same problem as well, I am trying to send 👇
PATCH http://localhost:5000/api/flows/{{flow_id}}/copy
Content-Type: application/json
{
"v3.home": "Hi {{person.name}}! There are a few people I recommend you should connect with."
}
Here I actually intend to send {{person.name}} as is (it is not a variable) but the REST Client extension shows an error message.

You can use a file for the body to avoid executing variables
`### Create notification template POST {{baseUrl}}/NotificationTemplate Content-Type: application/json Authorization: Bearer {{token.response.body.access_token}}
<@ ./notification-template-1.model`
and file is
{ "TemplateName": "Template 2", "Description": "Some description", "Template": "Hello {{name}}\r\n You have just won {{value}} dollars!\r\n {{#in_ca}}\r\n Well, {{taxed_value}} dollars, after taxes.\r\n {{\/in_ca}}", "AlternateText": "Alternate", "Subject": "Subject", "IsActive": true }
@KresoJ I tried your solution and it gives the same error. can you confirm that it works for you like that?
The backtick character at the end is that required? Doesn't that mean that it actually sends the <@ ./notification-template-1.model as a string, and not the contents of the file