Question

Hi i'm starting to create some code in f# to access freebase data. I have started following this tutorial freebase but, even with the easiest test, it does not work, here you have an image:

The code: enter image description here

The Error: System.ArgumentException: The 'User-Agent' header must be modified using the appropriate property or method. Parameter name: name enter image description here

Does anybody now what I'm doing wrong? Is this FSharp.Data ready for production? Thanks!

Was it helpful?

Solution

Based on glancing at the source of this file it looks like some framework versions have a UserAgent property on HttpWebRequest but some don't, and the library you're using is assuming that your version of the framework doesn't when really it does. Perhaps try referencing one of the non-portable versions of the library?

Based on this thread it looks like this might be an intentional limitation when targeting the RT version of the framework (you would need to use HttpClient instead of a traditional web request if you want to set the user agent), in which case this is a bug in the type provider implementation.

OTHER TIPS

This is now fixed in F# Data 2.0.5. You can you use any of the 3 versions on FSI without problems now.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top