Forum Discussion
Hi @bepelletier,
I tried to recreate the error you are getting by going on the path with the File Reader Snap, and yes, I got the same error message.
So it occurred to me to implement a workaround, and it appears to be functioning. Please find my solution in the attached pipeline.
The solution consists of using a REST Get Snap to make a call to http://api.pluralsight.com/api-v0.9/courses. The REST Get Snap will throw an error because, naturally, it tries to parse the $content field of the response as JSON, but the value of that field is CSV encoded data. Regardless, in the Mapper Snap connected to the error view of the REST Get Snap I map the necessary fields in order to write the $content (the actual CSV encoded data we want) to sldb with the use of a File Writer. After that I proceed to read the file from sldb as usual.
I hope this solution can be useful to you, in you particular circumstances. If you have any questions I’d be happy to help you further.
BR,
Dimitri
Read_HTTP_File_In_CSV_Format_2020_04_16.slp (15.2 KB)
P.S. : I should warn you that, at least in my case, when I try to preview the data at the error view of the REST Get Snap, the page in my browser tends to freeze. I guess that’s because the value of the $content is rather large, the file being 8+ MB in size.
- bepelletier6 years agoNew Contributor II
That’s clever! It’s kind of weird to start a pipeline getting good data from an error. My mind is not set for this kind of thing. But it is definitely working.
I thank you very much Dimitri.- dimitri_hristov6 years agoContributor
As an addition, or rather, a subtraction 🙂, I tried and removed the File Writer and File Reader snap, and connected the binary output of the Mapper Snap to the binary input of the CSV Parser Snap, and, it still works 🙂
Cheers,
Dimitri