Introduction

Restful web service encourages using HTTP.  That means the client that can talk HTTP will be able to consume the service. For the web, the tool that usually is JavaScript so that make sense to use JavaScript as a client programming language to built the application.

We can use a JavaScript with its HTTP request library to consume the service. Anyway, using library will reduce the development time. Today I will show you how use ExtJS JavaScript framework with Restful service.

Making HTTP Request

Below is example to make a HTTP PUT,

Ext.Ajax.request({
url: '/posts/',
form: 'post_form',
method:'put', params: {
author: 'Meledictas',
subject: 'Comsume RESTful Web Services using ExtJS'}, success: function(response, opts) {
var obj = Ext.decode(response.responseText);
},
failure: function(response, opts) {
console.log('Server side failure with status code ' + response.status);
}
});

Setting up the HTTP Header

You can define the HTTP Header like this,

var header = Ext.Ajax.defaultHeaders = {
'Accept': 'application/json'
};

And in your request code,

Ext.Ajax.request({
   defaultHeaders: header 
,
});

That all! Enjoy Restful!

Comsume RESTful Web Services using ExtJS

Comments:

Is there a way to set the header in httpproxy/scripttagproxy?

Considerably, the read is totally the freshest on this valuable topic. I fit in with your conclusions and will continuously look forward to your upcoming updates. Just saying thanks will not just be sufficient, for the fantastic usefulness in your writing. I will right away grab your rss feed to stay privy of any updates.

There are a lot of great points here, but I'm not sure I agree with real-time search being discarded. I agree that it's not very relevant,but isn't the point of it to show what people are currently saying about a topic.

I have this curl request below, which was successfully troubleshooted in another post. Right now, my PHP seems to work through this code without any errors, moves onto the next part of the IF statement and sends the confirmation email.

I'm trying to use an RSS feed from my blog on the news section on another site. Everything seems to be working fine until I use something like an ellipsis on my blog.

I cannot find solution last two days.i am finding a method and logically tip which free a memory.

Really restful using java script but it seems to be work on other coding language.I will try this method in php script.

I have been curious about this topic and decided to do some research. Your article has some useful information. Do you have any more on this subject?
<a href="http://www.nationaldebtreliefprogram.org/">Debt Relief Programs</a>

Making HTTP request is always a problem for me,thanks for sharing this as it has helped me to solved my problem.thanks for the view.

This is very helpful. Thanks for providing the information.

Nowadays, finding a high quality post is really difficult. I'd like also to thank my friend for giving me the url of your blog. Hope you appreciate my short comment though.

Yes you are right that Restful web service encourages using HTTP.But here the great solution to use ExtJS JavaScript framework with Restful service.the code given above for making a HTTP PUT is really works.

his can be a brilliant website. What i'm saying is this. You might have much knowledge about this issue, so a lot love. In addition, you discover how to make people rally guiding the idea, clearly through the replies. You have any design and style below this isn't as well fancy, nevertheless is really a affirmation as large as precisely what you are saying. Best wishes, in fact.

very good blog, I do think the write-up for you to build can help to all that make out the print. I've got to await this page at a later date.

very good site, I do believe the document for you to build can help to any or all which see clearly. I need to watch for this post at a later date.

Great post your given information does help me a lot knowing that you have shared this information here freely.

I’ve been visiting your web site for quite a while now and I always locate a gem in your new posts. Thanks for sharing!

When people travel to New York City, they get an opportunity to see a wonderful sight. They see a beautiful statue of a robed woman, with a book in one hand, and holding a torch towards the sky in other hand. Right from its crown to the foot, the measure of the statue is about 120 feet.

Post your comment:

Author:

  • meledictas

Archives:

Powered by Django.