Jump to content

Curl from Command Line


Recommended Posts

ok

Run(@ComSpec & '/c curl.exe --header access_token:****** "https://abc.com/......" -o output.json', "", @SW_HIDE)

but this not working as I unable to input $TokenID to access_token:

Local $TokenID = ******
Run(@ComSpec & '/c curl.exe --header access_token:' & $TokenID & ' ' & "https://abc.com/......" & ' ' &'-o output.json', "", @SW_HIDE)

 

Edited by jugador
Link to comment
Share on other sites

do double quotes around the token make it better or worse?  

Run(@ComSpec & '/c curl.exe --header access_token:"' & $TokenID & '" ' & "https://abc.com/......" & ' ' &'-o output.json', "", @SW_HIDE)

'unable' could mean lots of things, so if you could show the errors or clarify that would probably make for better guesses.

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

@Sidley

If https not double quote it’s not working from my side.

@iamtheky

Sorry my fault, rest of the code working except -o output.json not happening.
Anyway if put https & json output under single quote its work.

Run(@ComSpec & '/c curl.exe --header access_token:' & $TokenID & " " & '"https://abc.com/......" -o output.json', "", @SW_HIDE)

 

Edited by jugador
Link to comment
Share on other sites

  • Developers
11 minutes ago, jugador said:

@Sidley

If https not double quote it’s not working from my side.

your last posted run() command gives the exact same result as the one posted by @Sidley. ;)
Why have the confusing " " &  to add an space? Just keep it simple and readable:

Run(@ComSpec & '/c curl.exe --header access_token:' & $TokenID & ' "https://abc.com/......" -o output.json', "", @SW_HIDE)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers
56 minutes ago, jugador said:

btw how to tag '@ + name' not doing the job.

Yea, you need to select from the dropdownbox with names when typing @jugador, just typing the @name doesn't work in this forum.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...