How to receive a .CSV file ?
Bean
Posts: 8,129
I am wanting to get the prices of stocks from google.
If I send this request to google http://finance.google.com/finance/historical?q=FB&output=csv
from internet explorer, it will automatically ask where I want to save the file. (This is the stock price of FaceBook).
I'm wondering how this would be handled on the spinneret ? I would guess there is some kind of special header that signifies that a file is being sent, but I don't know for sure.
Does anyone know how the spinneret would handle this ?
Bean
If I send this request to google http://finance.google.com/finance/historical?q=FB&output=csv
from internet explorer, it will automatically ask where I want to save the file. (This is the stock price of FaceBook).
I'm wondering how this would be handled on the spinneret ? I would guess there is some kind of special header that signifies that a file is being sent, but I don't know for sure.
Does anyone know how the spinneret would handle this ?
Bean
Comments
Spinneret HTTP GET to finance.google.com => 74.125.224.194 port 80
The response
The message body contains the records delimited by 0x0A. Columns delimited by comas. The first column contains the column headers.
The Content-Disposition: header tells the browser to open the file stream using the application that handles *.csv files.
Bean
I'm sure you meant 0x0D and 0x0A, right?
-Phil
The first 3 bytes are 0xef 0xbb 0xbf. then the data starts.
The looks like the records delimiters are just 0x0a
@Coder96, you're right records are delimited by 0x0A and the file stream starts with a BOM 0xef 0xbb 0xbf.