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

Constructing the Torc Driverless Security Case

At Torc, we’ve structured our security case on three foundational pillars: Engineer It to Be Secure, Function It to Be Secure, and the...

What’s DL+S? Unlocking the Huge Information Required to Develop Autonomous Vans

Breakthroughs in AI for autonomous driving don't occur in isolation. They occur when information, simulation, machine studying, infrastructure, and car testing work as...

Why I can’t wait to get right into a driverless automotive | Self-driving automobiles

Adrian Chiles (Driverless automobiles are taking us on a street to nowhere, 10 September) needs to know who requested for driverless automobiles. I...

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here