i want to know how to send variables like Facebook.
ex: facebook.com/action-man.
here they will show actionman profile put i know how to send like this ex: facebook.com/users.aspx?user=actionman. so i want to know how to just send the username without the query parameter. thanks in advance
Use mvc routing engine. With MVC it is a must, so you should be already familiar with it.
If not, here you go:
http://www.asp.net/mvc/overview/controllers-and-routing
Related
Im looking for suggestions on the best approach to handle the below.
The ask is, run my scripts for 200 instances. The only things that would change would be url and username and passwords
Does anyone know what would be the best way to accomplish this? I was hoping for some kind of loop.
You can achieve your goal by utilizing template feature: http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#test-templates
and passing lists with your url, username, password as a parameters
I would like to retrieve Data from a remote api (via HTTP.get) and pass it to the client. Currently I manually poll the data and implemented some template helpers, that pass the data to the views.
In case of a jquery datatable I use the jquery-datatables package and that needs a published collection.
Has anyone a hint for me how to implement this?
Just for others who might want to know how to solve this:
You'll find an example here: https://github.com/avital/publish-time/blob/master/publish-time.js
The code is shown in this 20 min video: https://www.youtube.com/watch?v=onCkNRE2q0c
With that you'll be able to quickly implement custom publish/subscribe without using MongoDB.
#richsilv: Thanks again for pointing me to the right stuff.
I am designing a system that uses asp.net webapi to serve data that is used by a number of jquery grid controls. The grids call back for the data after the page has loaded. I have a User table and a Project table. In between these is a Membership table that stores the many to many relationships.
User
userID
Username
Email
Project
projectID
name
code
Membership
membershipID
projectID
userID
My question is what is best way to describe this data and relationships as a webapi?
I have the following routes
GET: user // gets all users
GET: user/{id} // gets a single user
GET: project
GET: project/{id}
I think one way to do it would be to have:
GET: user/{id}/projects // gets all the projects for a given user
GET: project/{id}/users // gets all the users for a given project
I'm not sure what the configuration of the routes and the controllers should look like for this, or even if this is the correct way to do it.
Modern standard for that is a very simple approach called REST Just read carefully and implement it.
Like Ph0en1x said, REST is the new trend for web services. It looks like you're on the right track already with some of your proposed routes. I've been doing some REST design at my job and here are some things to think about:
Be consistent with your routes. You're already doing that, but watch out for when/if another developer starts writing routes. A user wants consistent routes for using your API.
Keep it simple. A major goal should be discoverability. What I mean is that if I'm a regular user of your system, and I know there are users and projects and maybe another entity called "goal" ... I want to guess at /goal and get a list of goals. That makes a user very happy. The less they have to reference the documentation, the better.
Avoid appending a ton of junk to the query string. We suffer from this currently at my job. Once the API gets some traction, users might want more fine grained control. Be careful not to turn the URL into something messy. Something like /user?sort=asc&limit=5&filter=...&projectid=...
Keep the URL nice and simple. Again I love this in a well design API. I can easily remember something like http://api.twitter.com. Something like http://www.mylongdomainnamethatishardtospell.com/api/v1/api/user_entity/user ... is much harder to remember and is frustrating.
Just because a REST API is on the web doesn't mean it's all that different than a normal method in client side only code. I've read arguments that any method should have no more than 3 parameters. This idea is similar to (3). If you find yourself wanting to expand, consider adding more methods/routes, not more parameters.
I know what I want in a REST API these days and that is intuition, discoverability, simplicity and to avoid having to constantly dig through complex documentation.
I created a webpage by classic asp. A date was displayed in this page. But I want to display it with request country dateformat. So, I need to know which request came from? How can I know it? Thanks.
You will probably need to store a cross reference between language and the language's preferred date format. You can get the users language by using
Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")
I would like to know the meaning of the URL's provided by google for its Friend Connect.
For example, in the FCAUTH, the user details can be grabbed by sending a request to the following link and a JSON encoded string will be returned
http://www.google.com/friendconnect/api/people/#viewer/#self?fcauth=
Also for getting user activites, I came across a link as below
http://www.google.com/friendconnect/api/activities/#owner/#friends/#app?fcauth=
What if I change the #owner to #me or #viewer , what would be the meaning and would it be valid?
Example, if i change it as
http://www.google.com/friendconnect/api/activities/#me/#friends/#app?fcauth=
http://www.google.com/friendconnect/api/activities/#viewer/#friends/#app?fcauth=
Also, could some one suggest me where can I get the User Profile URL for the user using the same method as above?
Thankx guys
Thankx guys but I found the answer by myself. I thought of posting it here so that it might help others.
Its available in brief in the Opensocial website
http://www.opensocial.org/Technical-Resources/opensocial-spec-v081/restful-protocol
Hope it helps some