Easy methods to run multi-line curl assertion from a script in terminal?

on

|

views

and

comments


I’m making an attempt to run a curl assertion that I copied from Chrome DevTools. The assertion has a bunch of Header parameters.

If I paste this right into a Terminal window, it really works nice.

If I drop this right into a shell script, and run the script, every line is executed as its personal assertion, ignoring the backslash.

curl 'https://localhost' 
  -H 'authority: localhost' 
  -H 'settle for: utility/json, textual content/plain, */*' 
  -H 'accept-language: en-US,en;q=0.9' 
  -H 'referer: https://localhost' 
  -H 'sec-ch-ua: "Google Chrome";v="107", "Chromium";v="107", "Not=A?Model";v="24"' 
  -H 'sec-ch-ua-mobile: ?0' 
  -H 'sec-ch-ua-platform: "macOS"' 
  -H 'sec-fetch-dest: empty' 
  -H 'sec-fetch-mode: cors' 
  -H 'sec-fetch-site: same-origin' 
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36' 
  --compressed

Do I must prepend the script with one thing or invoke it a selected method? I do not do a lot shell scripting however I am positive that is a simple one for somebody to reply.

Share this
Tags

Must-read

Nvidia CEO reveals new ‘reasoning’ AI tech for self-driving vehicles | Nvidia

The billionaire boss of the chipmaker Nvidia, Jensen Huang, has unveiled new AI know-how that he says will assist self-driving vehicles assume like...

Tesla publishes analyst forecasts suggesting gross sales set to fall | Tesla

Tesla has taken the weird step of publishing gross sales forecasts that recommend 2025 deliveries might be decrease than anticipated and future years’...

5 tech tendencies we’ll be watching in 2026 | Expertise

Hi there, and welcome to TechScape. I’m your host, Blake Montgomery, wishing you a cheerful New Yr’s Eve full of cheer, champagne and...

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here