Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback for “Sync requests” #79

Open
LBaan opened this issue Jul 19, 2024 · 1 comment
Open

Feedback for “Sync requests” #79

LBaan opened this issue Jul 19, 2024 · 1 comment

Comments

@LBaan
Copy link

LBaan commented Jul 19, 2024

Dear Anoop,

I am using Bruno-1.21.0, and I want to use this code to sync requests:

const axios = require("axios");
 
const response = await axios.get("https://api.github.com/users/usebruno");

Unfortunately this is not working :-(
The Response shown is this: Error invoking remote method 'send-http-request': SyntaxError: Unexpected identifier
As far as I can determine this is cause by the await.
If I wrap it in an anonymous function like this:

const axios = require("axios");
 
(async () => {
  const response = await axios.get("https://api.github.com/users/usebruno");
})();

it works (but the calls are asynchronyous, which is not what I wanted)

Kind regards,
Leen Baan

@LBaan
Copy link
Author

LBaan commented Jul 19, 2024

I tried this code in Pre Request and Post Response under Scripts, and in Tests, always with the same result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant