real1975
real1975

Reputation: 11

curl use: codification of "&" in web parameters

I am having problems to get the following url with curl (in chrome works perfectly)

curl --user "user:pass" -v http://www.reuters.com/finance/stocks/incomeStatement/detail?stmtType=INC'&'perType=INT'&'symbol=GG

Any clue?

Upvotes: 1

Views: 38

Answers (1)

Armand
Armand

Reputation: 24393

  1. Surround your URL with ' marks:

    curl --user "user:pass" -v 'http://www.reuters.com/finance/stocks/incomeStatement/detail?stmtType=INC&perType=INT&symbol=GG'
    
  2. Surround your URL with " marks:

    curl --user "user:pass" -v "http://www.reuters.com/finance/stocks/incomeStatement/detail?stmtType=INC&perType=INT&symbol=GG"
    
  3. Escape the & characters:

    curl --user "user:pass" -v http://www.reuters.com/finance/stocks/incomeStatement/detail?stmtType=INC\&perType=INT\&symbol=GG
    

Upvotes: 1

Related Questions