Questions tagged [rest]

REST (Representational State Transfer) is an innovative software architecture approach tailored for distributed hypermedia systems like the vast expanse of the Internet. Its rising popularity can be attributed to its ability to effectively separate client and server, achieved through the implementation of a uniform interface that connects diverse systems together. This distinguishes it from traditional RPC architectures like SOAP, offering enhanced flexibility and integration capabilities.

A collection of text elements within an API request,

Correct Answer below. I need help with selecting products in bulk rather than individual calls. I've tried multiple syntax combinations but keep receiving 404 or 405 errors. I'm trying to compile a list of product codes, but the error codes persist. Ins ...

Issue detected with XMLHttpRequest - "The requested resource does not have the 'Access-Control-Allow-Origin' header."

Currently, I am working on the frontend development of an application using Angular 2. My focus is on loading an image from a third-party site via XMLHttpRequest. The code I have implemented for this task is as follows: loadFile(fileUrl) { const ...

Tips for transforming an html form into an ajax request for a rest controller when dealing with a multi-select field

I am encountering an issue with the field "roles" as it is a select list with multiple choices. I need to convert this field into an array, but I have not been able to find any information on how to do so. Any assistance would be greatly appreciated. Thi ...

Looking for guidance on integrating REST API consumption features into Ionic Framework 3.x?

It's been a long time since I last used the ionic framework. The version I worked with was 1, where every page created with Ionic Creator had its own controller for adding JavaScript code to consume my REST framework. Now that I've downloaded the latest v ...

Optimal techniques to ensure model validation through the utilization of a REST API and a cutting-edge javascript front-end like Angular

As I delve into developing more responsive front-end web applications, a question arises regarding model validation. Let's set the stage: our server has a REST API that handles various operations such as inserting, updating, and retrieving data. It can be ...

Transmit data to a modal popup in Angular 8

Here is the code snippet written in .ts file: openFormModal(id: number) { console.log(id); const modalRef = this.modalService.open(PartidoComponent); modalRef.componentInstance.id = id; //modalRef.componentInstance.id = id; modalRef.r ...

What could be causing my fetch() function to send a JSON body that is empty?

I've been struggling with sending JSON data using fetch as the backend keeps receiving an empty object. In my Client JS code, I have the following: const user = "company1"; const username = "muneeb"; const data = {user, username}; fetch("http://127.0.0.1 ...

Is it possible to combine Mongoose Materialized Path with Mongoose Restify?

After successfully implementing a schema/model for a recursive tree structure in Mongoose, I have decided to enhance my current setup by integrating two specific packages designed to streamline the process: Utilizing mongoose-mpath will allow me to man ...

Efficient Inter-service Communication Utilizing a Common Object Layer for Request and Response Handling

Currently, I am working on a distributed system that is built on Spring Boot with communication between services being handled by REST API calls. With more than 8 services in place, I am looking to create a common communication layer or library for all of ...

Get image data from Next.JS API and show it in the web browser

I am looking to utilize my own next.js endpoints to request an image that I can then embed into my website. Currently, the issue I am facing is that the image seems to be immediately downloaded and does not display in the browser window. import type { Next ...

Dealing with null object values during Jackson parsing

I am currently utilizing the Jackson library and attempting to accomplish a task as described here BaseOperationRequest.java @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "command" ) @JsonSubTypes({ ...

What is the proper way to send a HTTP status code 409 (conflict) and a JSON response from a spring REST API when a duplicate email is detected while a user is registering

I have attempted a few solutions so far, including: Using the Response object, but I prefer to avoid utilizing the servlet API of JSP. Trying a solution that returns an HTML response with a status code, however, I need it to be JSON instead. Here is a ...

What is the best way to include optional parameters in a RESTful API?

I'm currently utilizing the REST API found at this link. Here is an example code snippet for reference: server = "https://rest.ensembl.org" ext = "/vep/human/hgvs/ENSP00000401091.1:p.Tyr124Cys?" r = requests.get(server+ext, header ...

Guide to integrating Gandi.Net API with Node.js in server.js

I'm a beginner in Node.Js and I'm currently working on creating a Mean Stack application. One of the things I need to do is call a 3rd party API, specifically Gandi.Net, from my Node.js code. My Node.Js and Express Application are being used to ...

Developing and updating API services in Node.js while connected to the internet

Our team is currently working on creating a Node.js application (or Service) that will generate custom APIs for each user, accessible at {theirUserName}.ourwebsite.com. Users will have the ability to modify endpoints, add parameters and authentication usin ...

Retrieve data from MongoDB using a REST GET method that allows for searching based on specific criteria in

Currently, I have a Node.js server set up with Express and Mongoose. My goal is to implement a search functionality using the GET method based on specific criteria provided as a JSON object. Can anyone assist me in implementing this feature? Alternatively ...

Creating JSON from a Jersey resource: A comprehensive guide

I'm currently working with Jersey and aiming to generate JSON output containing specific fields only: [ { "name": "Holidays", "value": "http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic" }, ...

Is there a method to retrieve the email address after obtaining the authentication token in Keystone?

Hey there! I was wondering if anyone knows if it's possible to retrieve a user's email address using the REST API v2.0 provided by Keystone for authentication in my application. I have been looking through the API docs and noticed that you can get user det ...

Steps to create a RESTful PUT request using AngularJS

I need help understanding how to make a RESTFUL API call using the 'PUT' method. Specifically, I am trying to update an edited profile but I am unsure of the correct syntax for the API call. Here is what I have attempted so far ... var modify = ...

Ways to ensure the security of my RESTful API?

I am currently working on an API built with node.js & express.js. At the moment, the API is unsecured which allows anyone to access and manipulate records using GET, POST, PUT, and DELETE requests. One of the challenges I am facing is that my REST API sho ...

Drupal 7 Web Service Implementation

Currently, I am managing a Drupal 7 codebase that includes a web service utilized by external iPhone and Android applications. The URL for this web service is like so: http://example.com/api/module_name/find.json?param1=xxx&param2=xxx I need to make a ...

Having trouble with Laravel Sanctum CSRF and NextJs 14 integration

Currently, I am facing a challenge with communication between my Laravel server and Next.js frontend. An error 419 related to CSRF is encountered when sending requests like login requests. I want to highlight that tests were carried out on the same Larave ...

Initiate an Ajax request solely for the elements currently visible on the screen

I am currently facing an issue that requires a solution. Within our template, there are multiple divs generated with the same classes. Each div contains a hidden input field with the ID of the linked target site. My task is to utilize this ID to make aja ...

Can a NodeJs REST API be deployed on the Google Cloud Platform?

I'm in the process of building a REST API with NodeJS. What are some recommended options for hosting or deploying my API? If Google Cloud Platform is not feasible, what other alternatives would you suggest? ...

The REST API request returns a response code of 0

I have been attempting to make an API call to the Insightly API using this code: var x = new XMLHttpRequest(); x.open("GET", "https://api.insight.ly/v2.2/Projects/Search?status=in%20progress&brief=false&count_total=false", true); x.setRequestHeade ...

AngularJS invoke scope function to 'update' scope data model

I've been grappling with this issue for a few days now and unfortunately haven't found a resolution. In my view, I have a basic list pulled from MongoDB and I'm aiming to refresh it each time I execute the delete or update function. Despite ...

A guide on successfully transferring JSON Data to an Express REST API

Currently, I am in the process of developing a REST API with Node/Express and have a query regarding the setup of the API along with integrating a JSON file. As an illustration, the JSON data that I wish to reference consists of an ID number, model, and co ...

Uploading Multiple Parts to Spring REST API with Angular Factory Service and $resource Module

I am currently using AngularJS to interact with a RESTful web service (which is powered by spring boot) via $resource. My goal is to upload files and send form fields in a single multipart post request, but I encountered the following error: When trying ...

The REST API in Python encountered an error when attempting to cast a JSONArray to a JSONObject

I'm working on a python script that has two main tasks: Parse a CSV file Send the parsed data to a remote server using its REST API So far, my code successfully parses the CSV file and converts it into a JSON object. However, when I try to send th ...

Unlock the Potential of Spring REST-JWT-JavaScript for Seamless Transitions

In my Java Spring REST back-end, I am implementing a security feature using Json Web Tokens instead of sessions. For the front-end, I plan to use JavaScript and jQuery for sending requests to the back-end, along with HTML. After a successful login, I stor ...

Android Studio encountered an unexpected object instead of an array at line 1, column 2 while attempting to execute a Retrofit request

Despite searching for a solution with Retrofit2 and following an online tutorial, I am still facing the same issue. The code worked fine in the tutorial but when I tried it on my own endpoint, I encountered the exception: java.lang.IllegalStateException: E ...

POST access not permitted in REST service

After creating a REST service and successfully connecting to it using JQuery ajax with JSON data, I encountered an issue specifically when trying to use the POST method. For some reason, the service is not being triggered during a POST request. The error ...

What steps are involved in setting up a RESTful service for a web application?

After extensive searching, I'm still unclear on how to approach the question posed in the title. The concept of RESTful was introduced to me just this morning, and the more I delve into it, the more puzzled I become. A few weeks back, I undertook the ...

What is the recommended way to integrate Auth0 with a RESTful API?

Recently, I've been considering incorporating Auth0 for user authentication in my nodejs API. To add to the mix, I'm utilizing a MySQL database for user sign-ins and also want to implement Facebook login functionality. However, I've hit a r ...

Exploring the concept of multi-tenancy with Spring Boot and React

I am currently working on building a REST API using spring boot with React as the frontend. The goal is for React to send GET or POST requests from the frontend in order to make modifications to the MySQL DB located in the backend through the REST API. W ...

The Node.Js application encounters an EADDRINUSE error upon being restarted

My question may seem repetitive, but please read it in its entirety before marking it as a duplicate or anything else. I've been learning node.js to create a rest API and have been making great progress. Everything was running smoothly until I encountered ...

The use of JSON format is not supported by the REST API method in [Java]

I am currently running tests on a REST API method in postman. The interesting thing is that when I perform the test using x-wwww-form-urlencoded, I receive the correct result, but when attempting it with the Json format, I encounter a status code of 500 - ...

What is causing my page to refresh when making an Ajax call? (e.g. triggering the servlet request again

I'm currently learning about RESTful web service implementation using Java in my development environment, which consists of Netbeans IDE with GlassFish v3. Within my project, I have a specific page URL called /inventoryList, which is mapped to the Invento ...

One REST/OData controller is throwing an HTTPException 406 while the others are unaffected

I am facing an issue with one of my Odata(4.0)/Rest controllers in my project developed using c#/.net 4.62. All controllers except for one are functioning correctly. The problematic controller consistently returns a 406 error whenever I attempt to call it. ...

Executing REST API calls from within a loop in AngularJS

for (var i = 0; i < pricingPlans.length; i++) { productServices.retrivePricingPlan(pricingPlans[i].Id.Value).then(function (objPricingPlan) { productServices.createPricingPlan(objPricingPlan.data).then(function (objNewPricingPlan) { ...

Converting JSON data in Spring MVC 3.2 for REST services

I am encountering an issue while attempting to send a List of data as JSON from my Spring Controller. The error message "Could not find acceptable representation" is being thrown. Below are the snippets of code from different parts of my application: pom. ...

Interacting with JIRA using Java for handling requests and responses through its REST

This is my first question on stackoverflow. I am trying to implement a post request (using an inputBean/pojo class for necessary parameters) and receive a response (using an outputBean/pojo class to map the json response) using the Jira REST API. Currently ...

HTTP request in Angular with specific body content and custom headers

My goal is to access the sample API request from , as demonstrated in the documentation: curl -H "api-key: 123ABC" -H "Content-Type: application/json" -X POST -d ' ...

What are the steps to implement background synchronization in place of making fetch requests upon UI changes?

Consider this scenario: A straightforward web application with a comments feature. In my view, when a user submits a comment, the following steps would typically unfold: Show UI loader; Update the front-end state; Send a fetch request to the API to post ...

Is it possible to seamlessly alternate between JSON using the Jackson processor and XML using XStream, or is it feasible to use both formats simultaneously

I am in the process of developing a Web Server that can convert an Object into both JSON and XML formats. I have successfully used Jackson to serialize an object into JSON through my REST Interface, but I also need to support XML serialization. Recently, ...

Creating a JSON body using a JavaScript function

I am looking to generate a JSON Body similar to the one shown below, but using a JavaScript function. { "events": [{ "eventNameCode": { "codeValue": "xyz api call" }, "originator": { "associateID": "XYZ", "formattedName": " ...

Using AngularJS client and Flask server for a RESTful call, one can include the

I am currently facing an issue where I need to send a REST request from my AngularJs client to a Flask server. The problem arises when one of the ids (key) in the request contains a forward slash. Interestingly, if the key does not contain a slash, the re ...

Is it beneficial to consolidate masterdata calls into a single call?

Our application is built using REST with an Angular 2 client. We frequently make calls to master data APIs such as country and agreement during login, totaling around 6-7 calls. From a performance standpoint, would it be beneficial to consolidate these c ...

Creating a RESTful API

To begin with, I am a newcomer to web frameworks and we are currently using Meteor. In our database, we have a collection of Students: Students = new Mongo.Collection('students'); At the moment, we have defined a Rest API as follows: // Maps t ...

Implementing Partial Updates (PATCH) in a Restful Web API Server using .NET, JSON, and EF6

I've been delving into a Web API project (Restful) that involves working with large models and tables, making Partial Updates a necessity. Exploring the option of POSTing to a subset of the model doesn't seem practical due to the sheer number of ...

What is the best way to verify the JSON request in a Spring Boot application?

I need to verify the JSON request I receive from the client side. Despite successfully using annotations like @notnull and @length(min=1,max=8), I am struggling to access the specific fields and error messages that are triggered when validation fails. Alth ...

Utilizing Node Express for RESTful API creates a seamless error handling system

I have been working on developing a series of RESTful API services using Node.js Express. Whenever an error occurs, it is accompanied by a stack-trace with the following message: Error: No default engine was specified and no extension was provided. I h ...

Tips on incorporating the authorization header in the $.post() method with Javascript

When attempting to POST data to the server, I need to include an Authorization header. I attempted to achieve this using: $.ajax({ url : <ServiceURL>, data : JSON.stringify(JSonData), type : 'POST', contentType : "text/html", dataTyp ...

Exploring the possibilities of JavaScript within the IntelliJ REST client

I've delved into the extensive documentation provided by JetBrains on their HTTP Client and how to incorporate requests using files with a .http extension. The challenge I'm facing involves utilizing a function from a separate .js file within on ...

What is the best way to integrate JQuery code with Spring Restful services?

My Spring MVC project incorporates RESTful principles and jQuery code. However, I have noticed that the jQuery code does not work when the project is configured as a RESTful application. Strangely enough, when it is not set up as RESTful, all jQuery code f ...

Serialization and encoding using json.NewEncoder and json.NewDecoder

I am currently delving into Backend development by constructing a very basic REST API using the gorilla mux library in Go (referring to this tutorial) Here is the code that I have developed so far: package main import ( "encoding/json" "ne ...

REST API Express - DELETE Endpoint

I'm facing an issue with the delete functionality in my API. In order to use my application, a user must log in and then they can add courses. These courses are stored in a nested array within the User model. I want users to be able to remove (delete) ...

Having trouble making modifications to the pom.xml file in Eclipse JEE?

Is there a way to modify the pom.xml file without it reverting back to its original state? I'm trying to remove comments so that dependencies of JSON response can be utilized. Any suggestions on how to make permanent changes? Your assistance is greatly ...

Utilizing the jQuery library for flexible REST API requests with the incorporation

I'm currently utilizing jQuery getJSON to fetch posts from the WP API v2. There are some input fields that I'd like to make clickable, and then add extra parameters to the request URL. Here are some example requests: Posts - https://www.example ...

CakePHP 1.3 - issue with JSON REST call not rendering correctly

I recently followed a tutorial on setting up a REST webservice for JSON and XML. While XML outputs correctly, I encountered an issue with JSON calls which resulted in the "view not found" message from Cake. To address this problem, I made some modificatio ...

Using $location in a factory is a common practice when working with AngularJS

I have developed a factory that utilizes the $resource factory. I would like to customize the URL parameters passed to the $resource based on my current URL. Here is an example of my code: MyApp.factory("provider_services", ['$resource', function($resourc ...

Are Java classes specifically designed to handle the responses from Camunda's Rest API available?

Currently, I am setting up REST calls from Spring to my local camunda instance using the camunda rest api. This is how I've configured it: I have launched a local camunda docker container on localhost:8080 following this link: (I have verified t ...

Java - RESTful API endpoint that serves images when available and JSON data when images are not available

I am currently working on incorporating a mobile front-end using the Ionic Framework along with the $cordovaFileTransfer plugin. My focus is on fetching and uploading a person's Profile Photo. Uploading the photo is functioning properly, but I am enco ...

How can I ensure that null columns are included in the JSON output generated with apex_json?

Within my 19c database, I have multiple stored procedures that utilize the apex_json package to convert cursor results into JSON for a rest API. Recently, I encountered an issue where certain columns I select contain null values. As a result, these column ...

Node.js-based imposter server for simulating REST API

There are many instances where I find the need for a simulated REST server, one that generates fake data, allowing me to begin coding before the actual service is completed. I am in search of a simple and speedy solution to build this fabricated REST serv ...

Decomposing the Retrofit response.body()

I am having difficulties with implementing Retrofit and understanding how to interpret the response body. I believe that there might be an issue with mapping my JSON data to POJO because the output is not what I expected when I print it out in the log. He ...

Guide to executing a PUT request using Node.js

Here is the code snippet from my app.js file: import bodyParser from 'body-parser'; import cors from 'cors'; import requestIp from 'request-ip'; import os from 'os'; import { AppRoutes, AuthRoutes } from './routes'; const app = express(); app.use(cors() ...

Flask Server produces a response with a considerable delay when accessed through AJAX

I am currently running 2 servers on localhost, each with different ports. One of them is a basic flask server in Python and its code is provided below: from flask import Flask,jsonify from flask_cors import CORS app = Flask(__name__) CORS(app) @app.rout ...

Issue with smart table sorting functionality

I've been working on a table with just one column that is populated from a string array. However, I'm struggling to get the sorting functionality to work properly. Can anyone pinpoint what mistake I might be making here? Steps taken so far: 1) Double-ch ...

Eliminate the use of backslashes in JSON responses when using the WordPress REST API

As I work on extending the Wordpress Rest API, I encounter backslashes even after adding json flags to eliminate them. Below is what I am attempting: stripslashes(json_encode(['success'=> true], JSON_FORCE_OBJECT | JSON_HEX_APOS)); The outpu ...

Tips for instructing SharePoint 2010 listdata.svc to provide JSON through the URL

I require the JSON response from the following unique URL: After referring to a reputable online source, I attempted to modify the URL with additional parameters but unfortunately, it did not yield the desired outcome. The altered URL looked like this: D ...

React Native: Prevent FlatList from infinitely calling onEndReached when an empty JSON array is returned from the REST API

Utilizing the infinite scrolling Flatlist design pattern in my react-native application, I have encountered an issue. After completing pagination with the REST API, it returns an empty JSON array which triggers an infinite loop in the onEndReached function ...

Transferring information from a React form to an ExpressJS backend and then seamlessly redirecting to the PayuMoney platform for secure payment processing

Challenge Overview : I am currently working on the integration of payuMoney in a website built with ReactJS, NodeJS, and Express. The goal is to create a form where users can input their data, and then pass this information to the backend API located in in ...

Utilizing API routes within your React application

After creating my own API using nodejs, express and mongoDB, I successfully tested the routes with postman. However, I am struggling to integrate these routes into my react app for CRUD operations on the data. Despite having previous experience working wit ...

Tips for extracting JSON data from an API with identical names as values

I am working on a project to create a data search system using JSON. The JSON data is stored in a REST API, and the structure of the API is as follows: [ { "info": "cute but big animal", "type": "pig", ...