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.

Filter by
Sorted by
Tagged with
2
votes
1answer
44 views

Golang REST API that CRUDS in-memory object

Hey everyone I have a very simple go REST API that is running CRUD operations on an in-memory object. I would love some feedback on how I can refactor this code, and how/if I should break this up into ...
1
vote
0answers
29 views

Anything Wrong with This Method of API Versioning Using Flask?

I'm trying to find a sensible way to structure a REST API written in Flask. I'm new to writing such things and I've not seen this structure used anywhere else, so before I continue I wanted to ask ...
2
votes
1answer
80 views

C# REST / Http Client Abstraction

I have a REST library. These are the abstractions. Have I missed anything that a developer would need to use this in a dependency injection / IoC Container scenario? Anything that bothers you about ...
3
votes
1answer
59 views

Centralized REST API request dispatcher

Recently I had to implement a Windows Service that connects to the Shopify REST API and pulls essentially everything new into some SQL Server database, on a hourly basis; I've also implemented a small ...
1
vote
3answers
68 views

Code to pass json data with WCF REST POST

I have a WCF REST POST that has JSON data as input, IService.cs: ...
5
votes
0answers
112 views

what is the correct way to write an endpoint?

Here is a rather large endpoint that I have written in Python using Flask and SQLAlchemy, I was wondering if there are any tips I could get. The endpoint takes a post request which contains specific ...
-1
votes
1answer
46 views

Accessing function of class A from RESTful API that runs in class B [closed]

I have the following code ...
1
vote
0answers
30 views

Ecommerce site shipping data

I have REST API written on laravel and front end on vue.js. It is a dashboard for an ecommerce store where you can connect to post shipment service API to upload order shipment data and get tracking ...
1
vote
0answers
51 views

Web API get data with many optional parameter in .NET Core

I would like to do a refactoring of web API implemented in .NET Core. The Goal is to simplify ...
5
votes
1answer
114 views

Testable REST API Client

GitHub and NuGet Allows to invoke public/private REST API just by defining an interface. 200 lines of C# in total. Demo Sample API is publicly available at http://jsonplaceholder.typicode.com: <...
7
votes
3answers
223 views

Unit testing a REST API in Go

I am learning Go by writing a simple CRUD REST API using gotilla/mux and Gorm. I would like to get some feedback on the application code and on unit tests in particular. Please suggest me what to ...
5
votes
0answers
87 views

Using ClientFactory-pattern with Dependency Injection

I initially posted this on Stackoverflow but was recommended to try here instead. I'm looking for feedback on why the implementation of my ClientFactory is probably bad, from a Dependency ...
2
votes
1answer
47 views

REST call helper function returns empty response on timeout errors [closed]

Please review my code where I want to handle the timeout errors and send parsed JSON response if any. There are times when a POST request does not ALWAYS return JSON code. ...
2
votes
1answer
76 views

Simple Banking application in Spring boot, JPA, REST where balance can be transferred among predefined accounts and transaction history retrievable

I want to create a very simple banking application where (i) predefined accounts with a positive balance can send money (ii) requesting balance and a list of transactions can be found. I have ...
3
votes
1answer
142 views

Rest Api with generic crud operations

I am learning how to create a rest api in which I've decided to use generic for crud operation. I am attaching the code which I have written so far. Please have a look. Thanks for the review in ...
6
votes
3answers
164 views

Generic method to call API functions with simple retrial on errors

I have to develop a small security management application that relies on a Web API. Based on that API, I have generated the REST client classes (Open API generator), but I still have to code on top to ...
1
vote
1answer
72 views

Simple CRUD back-end for an inventory-tracking web API

This is the simple back-end, albeit crude, that I made for a React Native mobile app project as a proof of concept. It's a basic CRUD for tracking supply inventory. The "shopping list" is items with a ...
3
votes
0answers
42 views

HTTP Delete,Put,Get,Post REQUEST java-ee RESTful services JPA CDI EJB

I am creating introduction app to java ee and APIs of java ee and i want know if my code is ok (like its working but if it could be done better) and what should i avoid in future ...
2
votes
1answer
49 views

Simple Go REST API that returns dummy messages

I am a learner in Go and wrote example below in a day so I would like to get some suggestions to improve it. It is a simple rest api that currently just accepts request and returns a dummy message. My ...
2
votes
1answer
68 views

Spring RESTful API handling errors

I made a Spring RESTful api as backend for a website. I would like to get feedback on coverage of errors and the response I return accordingly, am I using the status codes correctly? Basically ...
2
votes
1answer
51 views

418 I'm a TeapotServer for RESTful integration-tests

I created a test-server for RESTful integration-tests that I call TeapotServer because I like the status-code 418 that the ...
3
votes
0answers
57 views

Rest API in a trimmed model

I practiced my Java knowledge in the last couple of days. For that, I want to create a Rest API in a trimmed scale, because there a lot of aspects which must be considered in such an API (Login, ...
1
vote
1answer
34 views

Optimizing calls for reauthentication by caching tokens and cookies

I am currently developing a REST service in ASP.NET Core 2.2 that acts as a wrapper upon a REST API provided by a reporting solution. The reporting systems REST API authenticates the user based on a ...
2
votes
1answer
35 views

REST API stored in a MongoDB Atlas Database

I am building my first REST API using data stored in my MongoDB Atlas Database. I tried to read the REST API conventions with the versioning, using plural nouns for resources and sending the right ...
1
vote
0answers
22 views

Trigger sirens on cameras in remote locations

Web-app summary: I'm a complete beginner in web development and I made a sample web application that can trigger sirens on security cameras located in remote locations. Here's the functionality seen ...
1
vote
1answer
64 views

Sign-up serialization in Python [closed]

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
84 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
156 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
164 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
17 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): ...
3
votes
0answers
72 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
736 views

Speeding up Excel distance calculation using Bing API calls

I am writing VBA 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 ...
2
votes
0answers
77 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 ...
3
votes
0answers
44 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
45 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
102 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
494 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
149 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
1answer
160 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
148 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 ...
3
votes
0answers
22 views

A XMLHttp Request in the browser

Building on a previous answer and an attempt to write a comprehensive XMLHttpRequest example that covers all kinds of possible errors and return them to caller ...
3
votes
1answer
92 views

Mini HttpClient json post by Action parameter

This is an implementation of HttpClient Json Post by Action parameter. Logic: It is mainly convenient to pass the url and object (automatically converted to json by Json.Net), and can use ...
1
vote
0answers
229 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
54 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
102 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 ...
4
votes
1answer
218 views

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
60 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
83 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
56 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 ...