Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [rest]

REST (REpresentational State Transfer) is a simple stateless architecture that generally runs over HTTP. It is an "architectural style" that basically exploits the existing technology and protocols of the Web, including HTTP (Hypertext Transfer Protocol) and XML. REST is easy to use than the well-known SOAP (Simple Object Access Protocol) approach.

1
vote
1answer
45 views

Sign-up serialization in Python [on hold]

I built a small project using Django-Rest-Framework. Please comment on the best practice style for the code below, which will make it simpler. ...
3
votes
1answer
61 views

Most efficient way to check if user is allowed to update an object

So I have an user which can create his own Locations. I implemented a webservice in order to add and update locations. If the user is not the owner of the location i want to throw an appropriate ...
7
votes
1answer
115 views

Build a set of REST interfaces using Symfony framework

I have got a technical challenge from a company but they reject my code and I'm not sure how to do this challenge in a more efficient way so I'm here to get some guidance. The Technical challenge was:...
5
votes
2answers
80 views

HttpClient reusable instance for simple calls on another methods

I wrote a HttpClient instantiable class that will be used as reference to simplify API calls in other methods inside other classes, so the user could call it in a ...
1
vote
0answers
15 views

Response structure with populated fields

I am working on a backend for an application using a microservice framework with Sequelize and it is populating in the following way (it does based on the table field): ...
2
votes
0answers
42 views

Node.js tool to update Cisco UCCX with CSV data

What this tool does update skills for agents on a Contact Center Cluster (Cisco UCCX). The tool reads a csv file called agents.csv from the current working directory. This file has a list of agents ...
6
votes
2answers
162 views

Speeding Up Excel Distance Calculation Using Bing API Calls

I am writing VB code in Excel to calculate the distance between an employee's home address and work address using Bing Maps API calls. The process follows this general flow: 1) Convert the employee's ...
0
votes
0answers
16 views

Given a resource ID, instantiate, retrieve and localize a Linked Resource for a REST API call

During a question on Stack Overflow, another user had some comments about the way this code works. He had a few choice words for it, including "magic", "ugly contraption", "you're doing things you ...
2
votes
0answers
34 views

Simple REST Base Web Server with Unit Tests

I am building out a simple web server in Go. My goal is to expand on this framework in a different application I am building. Here is my github repo https://github.com/jmacnc/gowebserver Is what I ...
2
votes
0answers
43 views

REST API request automation [closed]

I created a class to automate some requests for an API. Can I improve this code in any way? The code itself is very simple and easy to understand. ...
5
votes
2answers
95 views

Avoiding code repeating in RESTful APIS PHP

Since my last question related to this I have managed to create a working base and to understand how MVC works. I'm writing RESTful APIS in PHP, they serve the purpose but I see that my code is ...
2
votes
1answer
54 views

Effective & Secure Method to populate Access Token for authorization header in Rest Template

I am trying to consume a REST endpoint by using the RestTemplate Library provided by the spring framework. The endpoint also demands a Bearer Access Token as its authorization header, which is only ...
4
votes
2answers
90 views

Rest Controller in Spring Boot for Rock Paper Scissors REST API

I have created a Spring Boot Microservice for playing Rock Paper Scissrors. I have tried to follow best practices, but still would appreciate some critique on my code. Thanks. ...
7
votes
0answers
72 views

TDD tests for every view and its permissions in a REST API

I am currently developing a Django Rest Framework API with TDD. I have 15 tests and counting for two views, which doesn't seem right to me. It takes me a lot of time to write the tests and a lot of ...
1
vote
0answers
61 views

Implement versioning of a RESTful API with PHP/Slim and Apache

I want to create a RESTful API with Apache/PHP and the Slim Framework (3.x). The API should support URI-based versioning like ...
1
vote
0answers
57 views

Basic Kibana/Elasticsearch Search - Powershell

I am traditionally a Java/Backend Developer, and have recently been spending a lot of time dealing with issues that higher tiers of support should be able to handle themselves. To assist them with ...
2
votes
1answer
34 views

RESTful API echo server using Python bottles

I just wrote an echo server that responds to curl requests with the method used and the data sent. Sticking to GET and POST for now, but I would like to know if there's something I can do to improve ...
1
vote
1answer
77 views

Laravel show and update currency from rest api

I need: Daily save new exchange rates from the REST API in the database. Return the current exchange rate for a given currency, the whole table for a given day, the exchange rate for a given currency ...
1
vote
0answers
23 views

Fetching specific records in a RESTful application

Basically what I'm trying to achieve here is I need to fetch a set of images based on the selected folder. Is this a correct way to do it? I'm using ZF 2.5, and have the following function in my ...
3
votes
1answer
106 views

Use Python along with the HubSpot HubDB API and the Blog Post API to create, update, and publish a batch of blog posts

My program automates the process of creating and publishing 152 blog posts quarterly. The blogging platform HubSpot has a series of APIs that allow developers to access account data from a CLI in ...
1
vote
1answer
59 views

Set / verify password using REST API

I have limited experience with both making REST APIs and implementing security features, so I figured it'd be worth running this code through some other people's eyes before making it live. My main ...
1
vote
1answer
75 views

Wrapper for REST API calls

This is a wrapper that can be used to do additional external REST call to some API. Since I have to provide support to legacy code so I added three static functions to support them. However, the ...
0
votes
1answer
49 views

Refactor REST service with overcomplicated logic

Need to perform such actions: receive JSON from REST extract nexted JSON document calculate hash of the nested document add some fields to extracted document and save it in database return response ...
1
vote
0answers
20 views

Deletion button on a website that enforces database integrity

I am designing a website on which users can configure (CRUD) various objects which are mutually dependent upon other types. I am preventing a cascade delete, so let's say a ...
1
vote
2answers
57 views

Unlist all NuGet packages but the last version

I like to unlist my old NuGet packages to keep my catalog clean. However, after a couple of uploads it's always a pain to remove each single package manually so I thought I write a utility for it in ...
0
votes
1answer
264 views

Python script to query REST API and write to database

I wrote the following sample script for learning purposes: ...
1
vote
0answers
60 views

Consuming rest api

I want to consume api from site. Lets say its url is http://www.example.com, and you can get the user data by sending POST to <...
2
votes
0answers
852 views

REST API with flask structure and implementation approach

I recently started writing REST API, I wanted to have a proper structure of project and an approach which is more readable and make more sense interms of organising in a logical order. I took ...
0
votes
1answer
52 views

Python client to fetch JSON data from REST API, retrying on failure

As a beginner, I'd like to see if anyone can suggest any better way of coding the below, as I'm duplicating code and nesting identical if statements as part of the following problem. I'm grabbing ...
0
votes
1answer
755 views

Toy Robot coding puzzle with Java

The following code is my solution to a code challenge I submitted a few days ago. I got rejected straight away with no feedback and I've wondered why. Here is the full code repo. Requirements ...
6
votes
3answers
5k views

ASP.NET REST controller with try-catch error handling

Yesterday someone guided me through this article and I'm wondering whether I should use try-catch implementation or not? I have the following code below which is actually a RESTful service and I have ...
2
votes
0answers
468 views

Create HttpClient using PoolingHttpClientConnectionManager

I have a java service class which will call a REST service and get response back. It is working fine in developer environment where less requests are made, but I still wanted to get a review. My ...
1
vote
1answer
126 views

Using coalescing and conditional operators to check API arguments

I have a web application that allows users to create customs items and later change those items. For eg. a change, the application takes the parameters and performs some basic sanity checks. If the ...
3
votes
1answer
144 views

Enforce request completion order using Multiple Promise Chaining

The main entry point is the SyncmyCompany() function. I have a interesting scenario where I'm syncing data from a Company to a destination system. In this case ...
2
votes
0answers
540 views

Parsing XML file from the REST API

Please suggest how I can improve my code (like memory leakage, which pattern to use etc.). I have to parse a book XML in two ways: first from an FTP file and second from the REST API. I implemented ...
2
votes
1answer
161 views

Class to make Web Service calls

I've a web service class to handle all requests to the external service. All the methods are very similar, so I want to refactor this into DRY code. This is an app in Xamarin.Forms. I'm making the ...
3
votes
3answers
61 views

REST API for random number generation using Falcon

I have written REST API for random number generation using Falcon(https://falconframework.org/), just for my learning process. This is API: ...
3
votes
0answers
350 views

Scraping website and print them via routers

I've been working on a personal project for a while which simply extracts some information from a website and save them as JSON files. Then I've decided to move those scraping functionalities to the ...
3
votes
1answer
137 views

Restful CRUD API with Node.js and Express

I build a RESTful CRUD API with Node.js and Express. This application allows, for example, to create a table on the client side with the ability to add, update and remove data by ID. I generate an ...
3
votes
1answer
388 views

Laravel token middleware

I want to make my API unavailable to every client who doesn't have the token to access. This means the Android app will send a client as Android and ...
2
votes
0answers
201 views

Setting many properties in a PHP class

I'm trying to define parameters for my API. It's a super basic one and the first I've made. I'm trying to instantiate my class and set parameters but to me it seems super messy. Is this really the ...
3
votes
1answer
26 views

Consume rest endpoint removing payload's unwanted properties and falsy values

Let's suppose that there's a third part web service and I want to make a GET request to it and use the response to feed my project's service. Next code will allow me to create a dict object only with ...
3
votes
1answer
82 views

API Gateway for blocking api calls

I recently had a programming interview, where I had to create an Api Gateway. The description is as follows: You need to create a gateway in which it only allows certain number of callers to call ...
3
votes
0answers
133 views

Extendable REST-Client - follow-up

My previous RestClient wasn't disposing a lot of resources. I've fixed it (hopefully without introducing new issues) and because a few new patterns emerged I did a ...
4
votes
1answer
844 views

Extendable REST-Client

I've been working on a REST-client. The client itself provides only very basic and generic functionality. Everything else is done with extensions. Its raw usage does not need to be convenient but ...
0
votes
2answers
719 views

A small api that delays api requests using async/await with Node.js

I spent a good couple hours troubleshooting a bug where the yelp-fusion api said I was sending too many requests per second, so I finally found a way to delay each api request to make it work. Please ...
4
votes
0answers
561 views

AWS EC2 metadata fetcher in Python

Update https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html This seems to be the schema for the instance metadata, though the way they describe it isn't really handy for ...
3
votes
1answer
135 views

PHP RESTful API for a student repository

All of the codes are based on the PSR-2 standard. Also Dependency-Injection and Repository patterns are followed. I would love to hear some advices or comments. StudentRepository Class ...
2
votes
0answers
407 views

RESTful API combining three other APIs

I have created a RESTful API that uses three other APIs with Visual Studio 2017 in .NET Core. It is the first time I have ever programmed in .NET so I am sure the code could use a lot of improvements. ...
3
votes
1answer
288 views

Angular + Redux app organization and initialization: transfer from a PHP-driven website

Our system is largely a PHP-driven system. We're not doing the full split back/front-end. Most pages are plain HTML served directly by PHP. However, a few parts of the system are very dynamic and ...