REST

155

Solutions

1

Articles & Videos

315

Contributors

Representational state transfer (REST) is an architectural style that gives a coordinated set of constraints to the design of components in a distributed hypermedia system used to design networked applications. RESTful systems typically communicate over Hypertext Transfer Protocol (HTTP) with the same HTTP verbs (GET, POST, PUT, DELETE, etc.) that web browsers use to retrieve web pages and to send data to remote servers. REST interfaces with external systems using resources identified by Uniform Resource Identifier (URI) that can be operated upon using standard verbs.

Share tech news, updates, or what's on your mind.

Sign up to Post

We have a vmware cluster with standard switches. I am planing to migrate from vSS to vDS. I would appreciate if you could direct me.
We have standard switches for management, iscsi, vmware, vmotion and DMZ, all these are in separate vSS. The esxi hosts do not have any spare nic. I will be able to disconnect 1 or 2 uplink from existing vSS and connect them to vDS.
Can i migrate one switch at a time. for an example migrate iscsi switch to dVS-iscsi  and leave the rest at vSS for now?
0
MIM Survival Guide for Service Desk Managers
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Dear Sirs,
I have a web app rendering html and exposing at the same time some REST end points.
I have 2 two classes annotated with @ControllerAdvice:
1) A Class will manage all the errors generated on the web side of the application, and redirects to an Error view page
2) The other Class will manage all the errors generated on the REST side of the application and returns an ResponsEntity<Object>

I have some custom exceptions such as NotFoundException, AccessDeniedException, etc.. And there is a generic ExceptionHandler for the Class Exception.class in both the 2 @ControllerAdvice Classes: 1 for web side exception and 1  for REST side exception.

The confusion  I am seeing is that when the generic exception occurs, while I am consuming the REST end points, I will get an HTML error view instead of a Jackson string representing the ResponseEntity<Object> and vice-versa.

How can I handle this. Make @ControllerAdvice Class 1 only look at exceptions generated by all the classes annotated with @Controller, and @ControllerAdvice Class 2 only look at exceptions generated by all the classes annotated with @RestController.


Thanks a in advance
0
Dear sirs,

I have CSRF enabled in my REST application.
I use either RestTemplate or Postman as Client.
How can I set the application in a way that each request (POST/PUT/DELETE) is carried with a token in its header.

I remember using an implementation of  ContainerRequestFilter while working on Jersey, and I could take care of my requests globally.

I am looking forward to hearing from you.
0
I have a user form that is created in extjs framework. The user form has many user fields which are being passed as part of request payload to the REST controller. I am trying to add a grid panel(most likely in a tabular format with multiple rows & columns) to the user form. But I am not sure how to pass the grid panel data as part of request payload to the REST controller. I will post more code if any more details are needed. Any help would be appreciated. Thanks.

Ext.define('soylentgreen.view.admin.UserForm', {
    extend : 'Ext.form.Panel',
    alias : 'widget.userform',
    bodyStyle : 'padding:5px 5px 0',

// some userform elements like firstname,lastname, go here.....

name : 'userTeamGrid',
  xtype : 'gridpanel',
id : 'userTeamGrid',
itemId : 'userTeamGrid',
multiSelect : true,
selModel : Ext.create(
        'Ext.selection.CheckboxModel',
        {
          injectCheckbox : 'first',
          mode : 'MULTI',
          checkOnly : false
        }),
anchor : '100%',
width : '700px',
height : 250,
flex : 1,
store : 'userTeamStore',

var user = form.getRecord();
form.updateRecord(user);
user.save({
        callback : function(records, operation){
          //reset the (static) proxy extraParams object
          user.getProxy().extraParams =  {
            requestType: 'standard'
          }
          if(!operation.wasSuccessful()){
            var error = operation.getError();
0
I am trying to call REST services deployed on Tomcat 8 from Angular 4. Since both these are running on separate domains, CORS issue is expected. So, in the tomcat/conf/web.xml, I have added the below filter
<filter>
  <filter-name>CorsFilter</filter-name>
  <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
  <init-param>
    <param-name>cors.allowed.origins</param-name>
    <param-value>*</param-value>
  </init-param>
  <init-param>
    <param-name>cors.allowed.methods</param-name>
    <param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
  </init-param>
  <init-param>
    <param-name>cors.allowed.headers</param-name>
    <param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Authorization,Access-Control-Request-Headers</param-value>
  </init-param>
  <init-param>
    <param-name>cors.exposed.headers</param-name>
    <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
  </init-param>
</filter>
<filter-mapping>
  <filter-name>CorsFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping> 

Open in new window


This is how I am sending the GET request from Angular
var basicOptions:RequestOptionsArgs = {
  url: 'http://server3:7000/myrest/info',
  method: RequestMethod.Get,
  search: null,
  headers: new Headers(
    {'Authorization': 'Basic AG1hZG1pbjpkZW1vLmRlbW8=' },
    ),
  body: null
};

basicOptions.headers.append('Content-Type', 'application/json');

var reqOptions = new RequestOptions(basicOptions);
var req = new Request(reqOptions);
return this.http.request( req );

Open in new window


Since, I am sending the Authorization header, it is also added in the 'cors.allowed.headers' param in Tomcat.

When I call the REST service from Chrome, it always gives me a 'Invalid CORS request' error (Network tab -> Preview). Below is the error in browser console
XMLHttpRequest cannot load http://server3:7000/myrest/info. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access. The response had HTTP status code 403.

Open in new window

Is there something else that I need to do to make it work?
0
I have an XML file that when passed through SOAP UI returns a proper response as XML file. I need to create an application to pass the XML and recuperate the response. I tried searching but many say REST web service where they using only post/get.

Please send me some sample code and/or tutorials.
0
I am exporting a table using pdfmake
The table exports, but there is one item that is 'undefined'.  

I have a main page with multiple tabs and once you hit the 'Printer Friendly' btn, a pdf report opens in a new tab for the specific tab you selected.  The 'printer friendly' btn is what exports the page.  

This code broadcasts  the print function to produce the pdf report depending on what tab you are on.
$scope.printDiv = function(divName) {		
		$rootScope.$broadcast('print');		
	}
	

Open in new window


and the button
<button ng-click="printDiv('rollup-tab')">Printer Friendly</button>

Open in new window



Here is the rest of the code.

Table creation and exports the pdf pdf
$scope.$on('print', function(event, filter) {
			var docDefinition = {

					content: [	
					          {
						  table: {

					              body: [                   			                
					                [ 
					                  '',
					                  'Actual Pieces Issued',
					                  {text: $filter('mcGoalNumberFilter')($scope.actualPiecesMCGoal) + ' /wk'},			                  
					                  {text: $scope.actualPiecesMon, style: 'tableData'},
					                  {text: $scope.actualPiecesTues, style: 'tableData'},
					                  {text: $scope.actualPiecesWed, style: 'tableData'},
					                  {text: $scope.actualPiecesThurs, style: 'tableData'},
					                  {text: $scope.actualPiecesFri, style: 

Open in new window

0
I have an on prem SharePoint 2013 site collection.  On that site, I have a form where I can add list items (records to the external SQL table).  It has been working fine and dandy.  Yesterday, the table was migrated to another SQL Server and version (2016).  Now,  I can add and modify the records on any browser other than IE (used to work there).  I get back a 400 error.

Any advice on this would be greatly appreciated.
0
i want to send email notification to few external users .

Tried using designer 2013 /2010 workflow.

Also tried JSom code using Rest Api
0
Hello Guys , i need a GPO for work life balance , just locking computer automatically after 4 hrs of activity and unlock it after 10 min of rest
0
Is Your DevOps Pipeline Leaking?
Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

I am working with excel 2007 and I have changed my printer settings, selected all then changed the page set up, changed in print settings while under print entire workbook. All three option print the first page in color and the rest black and white and double sided. Right now I am going tab by tab to update the page setup - is there a better way to do this though.
0
Dears,
Some servers over the network I can open normally like \\severname\c$ with no issue but the rest of the servers I can't like I don't connect to the network.
I have windows 10 and this is normal netwrok with Microsoft active directory. The other machine I can connect and do it by my users to access all servers but not from my machine anymore.
Regards
Mostafa
0
websites provide android app fetching from rest api.
websites provide  rest api using c# with just one controller in project and sql server 2016 sending/receiving data for one table.
So these are not compact,efficient for complete project with multiple tables.
I am very curious to have modular code for all these concepts.
0
Why can't we write an efficient query to check if any results are not started with a set of alphabets? I am using this https://wordpress.org/plugins/alphabetic-pagination/ but i don't know that how can i check if rest of the alphabets are not having any results in it.
0
I am not a .net developer but work with PowerShell a bit.

Is this a process that is even possible and if so how do i get it done?

Thank you
0
Hi there:
Im working with an old project developed in delphi7 and am facing a problem with a TMonthCalendar componet. My goal is when the user press for example the up arrow key over the monthcalendar the date decreases 7 days, if presses the down key arroy instead, the date increases 7 days and so on. The problem is that when i try to capture those keys on the mousedown event i haven't a response on that particulars keys, working normally for the rest. Thanks in advance,
Klueze.
0
I need to find a way to patch my servers by function.  I want to patch the dev/test server, wait a week, patch the QA /staging servers, wait a week then patch the production servers.  This will allow the application support teams to verify  the patching didnt break their applications before being rolled out to the next level.   Same for the workstations.  Patch the Beta group of users, wait a week and then patch the rest.

Waiting to approve the patches doesnt fix my issue and the GPO only allows for a specific date.  Any ideas?  Btw:  Servers are 2012 R2 and desktops are Windows 10 pro.

Thanks,

Donna
0
Hi ,

I am trying to download an excel file using REST API. But I am getting the file in binary format. Please help.

I have tried with curl/wget.

Many Thanks
0
I have seen some snippets where the code uses a combination of Name/Title and $Expand to get more columns back from a REST call.  Can someone describe how to use these facilities to avoid making multiple calls to get back values?
0
Free Tool: Site Down Detector
LVL 8
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

I need to put together a couple of REST functions.  I need to add a list item and also to update a list item for a SharePoint/JavaScript module.

Any help on this would be appreciated.
0
I need to build the URL for a REST Call that will return the items that match a lookup value.  I have seen references to using expand.  But I haven't found a good example.

So far I've attempting something like the following:

getByTitle('AssetByFilmType')/items?$select=Assets, FilmType/FilmTypeID&$expand=FilmType&$filter=FilmType/FilmTypeID eq '"+ "SomeType" +"'"

The lookup column is called FilmType.

Thanks.
0
Hi I am java developer and I need to find out replies count on particular tweet so please help me.
0
Hi , I am getting the below error and  it says

"To use this template

Office 365 outlook , Please check your account info/Or permissions and try Details: REST API is not yet supported for this mailbox.

Please suggest me.
0
Hello all

I have seen numerous articles on the web regarding this issue and they talk about how you need KB3159706 installed and you have to make sure you do the POST install Tasks for it as well. Rest assured this KB is installed on the 2012R2 WSUS server and the POSWT INSTALL tasks have been done. This did not fix the issue

We also have the latest ADMX files installed in our GPO with the Delivery Optimization set to BYPASS MODE to force 1607 to run with BITS as also suggested in various articles. This made no difference

Windows 10 1511 Clients connect to the WSUS no problem and get updates. Works fine

Windows 10 1607 Clients will report to WSUS with a Last Status report time and date but WSUS says they are 100% up to date. This is not correct as if you go to client machine and check MS servers, updates are downloaded.

If you look below one with the Yellow "!" is the 1511 machine and it is waiting for update

The one right below is a 1607 machine. Says there is no update but go online and there is

Status.jpg
We need to get this resolved as quickly as possible as we rely on our WSUS server and all new machines are coming with 1607

Any help would be appreciated

Thank you
0
am trying to lock a node.js express website down for all routes except login, forget password, etc. I am able to hit the login page, forgotpassword, etc.; however, when I try to hit the reset password page by clicking on a link in an email of the form, http://localhost:3000/resetpassword?ua=55d48e9b2467717e1042e100f7f71990a04088a1c4eed26a67e7567993, I keep getting the "No authorization token was found" error. This route is in the unless list so I do not understand why it is falling through? Could it have an issue with the querystring parameter and if so what is the correct syntax?

Route Handler for Rest Calls
app.use('/api', expressJwt({secret: process.env.AUTH_KEY,
  credentialsRequired: true,
  }).unless({path: [{ url: '/api/forgotpassword', methods: ['PUT'] }, 
  { url: '/api/login', methods: ['POST', 'PUT'] },
  { url: '/api/resetpassword', methods: ['PUT'] }]} ));

Open in new window


Route Handler for the rest of the site

app.use('/', expressJwt({secret: process.env.AUTH_KEY,
  credentialsRequired: true,
  getToken: function fromHeaderOrQuerystring (req) {
    if (req.headers.authorization && req.headers.authorization.split(' ')[0].toLowerCase() === 'bearer') {
        return req.headers.authorization.split(' ')[1];
    } else if (req.query && req.query.token) {
        return req.query.token;
    }

    return null;
  }}).unless({path: [{ url: '/forgotpassword', methods: ['GET'] }, 
  { url: '/login', methods: ['GET'] },
  { url: '/index', methods: ['GET'] },
  { url: /\/css\/*/, methods: ['GET'] },
  { url: /\/js\/*/, methods: ['GET'] },
  { url: /\/images\/*/, methods: ['GET'] },
  { url: '/resetpassword', methods: ['GET'] },
  { url: '/forgotpasswordconfirmation', methods: ['GET'] }]} ));

Open in new window


Any help would be greatly appreciated.
0

REST

155

Solutions

1

Articles & Videos

315

Contributors

Representational state transfer (REST) is an architectural style that gives a coordinated set of constraints to the design of components in a distributed hypermedia system used to design networked applications. RESTful systems typically communicate over Hypertext Transfer Protocol (HTTP) with the same HTTP verbs (GET, POST, PUT, DELETE, etc.) that web browsers use to retrieve web pages and to send data to remote servers. REST interfaces with external systems using resources identified by Uniform Resource Identifier (URI) that can be operated upon using standard verbs.