Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have such a signature in API:
C#
public IHttpActionResult PostUser_Hotel(float user,float[] rating)

How should I proceed address bar?

http://localhost://User_Hotel?user=1&rating - ??


Thank-you!!
Posted
Updated 9-Jan-16 23:54pm
v2
Comments
OriginalGriff 10-Jan-16 5:33am    
if you are going to post a url - and personally I'd suggest that you don't, we don't like accessing random websites to look at unknown content so you are better off just giving us the text - then it's a very good idea to make sure that the link points to a "real" url. "Localhost" will reference my computer, not yours...

And this is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.

1 solution

There is no standard for this...It depends on the serve side and how it interprets the query string...
For instance PHP will accept the form of ratig[]=value1&rating[]=value2&rating[]=value3...
Where .NET and Java handles the form of ratig=value1&rating=value2&rating=value3...

If you want a form that not depends on the server than invent your own...
For instance a comma separated list can be a good choice, ratig=value1,value2,value3...
On the server side you can split it in whatever language you got...
 
Share this answer
 
Comments
Member 11919288 10-Jan-16 6:47am    
I am writing in MVC, and tried:
http://localhost//User_Hotel?user=1&rating=1.0&rating=3.5

But it does not work!!
thank-you!!!
Kornfeld Eliyahu Peter 10-Jan-16 6:56am    
That 'frating' is a typo here or it is real?
How your routing looks like?
Member 11919288 10-Jan-16 7:14am    
typo.
http://localhost//User_Hotel?user=1&rating=1.0&rating=3.5

thank-you!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900