Closed jeevanrd closed 8 years ago
This is a limitation. You may want to try storeId[0]=1001&storeId[1]=1002
instead. This should work too.
I'll try to lift this limitation for 4.0, but it's not there yet.
You mean to say, If I pass like below the request should go through?
request.AddParameter ("storeId[0]", "1001", ParameterType.GetOrPost); request.AddParameter ("storeId[1]", "1002", ParameterType.GetOrPost);
Yes, it might work (I've already seen this :wink:)
Sry, It didn't work out. Any other ways you can suggest to achieve this.?
OK, I'll try to fix this and get a new pre-release out tomorrow
Thanks @fubar-coder. Please leave a message here once you publish.
It's available as beta on the RestSharp.Portable MyGet Gallery. The NuGet v3 feed is: https://www.myget.org/F/restsharp-portable/api/v3/index.json
Be aware, that you have to use NuGet 3.5.0 beta to be able to consume this package. Please reopen this issue, when this issue is not resolved.
Getting error saying
'4.0.0-beta-01.10' is not a valid version string
I'll fix this ASAP.
What client do you use to install the NuGet packages? Where exactly does this happen? It works fine here when using Visual Studio 2015, both with .NET Core RC2 and .NET 4.5 console applications.
I pushed pakages with a new version number: 4.0.0-beta1-012
. I hope that your client can now handle this version number... Maybe your dotnet
tool is too old?
I was using nuget client to install nuget packages in xamarin studio 5.10.2.
Does it work now? Maybe you have to use nuget 3.5.0 beta?
@fubar-coder. I was using xamaraion studo framework on MAC osx for this. I tried using nuget client 3.5.0 beta only to install packages in NET 4.5 console applications only. But still unable to add the package. It says " Adding FubarCoder.RestSharp.Portable.Core... Attempting to resolve dependency 'Newtonsoft.Json (≥ 8.0.4-beta1)'. Downloading FubarCoder.RestSharp.Portable.Core 4.0.0-beta1-012... 'FubarCoder.RestSharp.Portable.Core' already has a dependency defined for 'NETStandard.Library'. "
But My target is to create a PCL library using restsharp with targetFramework="portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10".
Thanks
That's it. Xamarin Studio doesn't support the new nuget packages. I'll do some investigation, and answer you again about possible solutions.
I made a back-port of the 4.0 changes to 3.3.0 (on nuget.org). Please try this version. You should be able to install this in Xamarin.Studio. Sorry for the hassle and thank you for your patience.
Sorry for giving you trouble once again. May be it's some limitations in xamarin studio. Still unable to add package. It's says "Adding FubarCoder.RestSharp.Portable... Attempting to resolve dependency 'FubarCoder.RestSharp.Portable.HttpClient (≥ 3.3.0)'. '4.0.0-beta-01.10' is not a valid version string. Parameter name: version"
The latest version is beta1-012. This should work
I changed the version number to avoid exactly this problem.
@fubar-coder Thanks for your patience. This also didn't work out. Still getting error "Adding FubarCoder.RestSharp.Portable.Core... Attempting to resolve dependency 'Newtonsoft.Json (≥ 8.0.4-beta1)'. Downloading FubarCoder.RestSharp.Portable.Core 4.0.0-beta1-012... 'FubarCoder.RestSharp.Portable.Core' already has a dependency defined for 'NETStandard.Library'."
If possible pls try to create a sample PCL library in xamarin studio and test adding this package to that
Thanks
Too long awake. Please use 3.3.0 from nuget.org. I made a backport.
Thank you very much for your patience. Finally issue resolved 👍 👍
Good :grinning:
Here is the code;
var client = new RestClient ("http://localhost:3000"); var request = new RestRequest ("products", Method.POST); request.AddParameter ("countryCode", "US", ParameterType.GetOrPost); request.AddParameter ("storeId", "1001", ParameterType.GetOrPost); request.AddParameter ("storeId", "1002", ParameterType.GetOrPost); var response = client.Execute(request).Result;
At the server end, only one storeId (the last one, 1002) is coming.
The same request via curl works perfectly.
curl -X POST --header "Content-Type: application/x-www-form-urlencoded" --header "Accept: application/json" -d "countryCode=US&storeId=1001&storeId=1002" "http://localhost:3000/products"
What I am my doing wrong here? Is this that the limitation?
Can some one pls advise.
Thanks