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
1 vote
0 answers
25 views

Making my code shine and pro: Python in Azure Function Retrieveing the Data From Rest API

The code retrieves the data from PBI API - it's my first one and I would like to learn how to make it pro. Here is the list of my questions: Can you please analyze 2 functions: GetReports and ...
2 votes
1 answer
115 views

Python REST API Calls Structuring

I am writing a python REST API library for Starburst and am trying to figure the best way to structure the code so it's dry but also easy to understand. Below is an example of code that is not dry. ...
0 votes
0 answers
23 views

General setup for ASP.net REST webapi

I am currently building a REST webapi. Right now I am wondering if this design is in the right direction. Firstly, I am using entity framework. I like to call the items in the database DbItems. The ...
1 vote
1 answer
110 views

blog RESTFUL api with posts and comments

I built RESTFUL api for a blog using java and spring boot(without a frontend). What it does the code manages all the http methods on a post inside the blog and comments on that post. the post consists ...
1 vote
2 answers
51 views

Spring Boot REST API for moving toy robot in 5*5 grid [closed]

I have designed and coded REST APIs to move the toy robot in 5*5 grid. Please let me know any feedback on improvements, etc Complete Code here: https://github.com/pkkht/RobotRESTApp ...
2 votes
2 answers
3k 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 ...
1 vote
1 answer
49 views

Rest API design with Spring Boot

In a recruitment interview I got this small projet to do at home: rest API written in Java using Spring Boot. As I didn't hear back from the company I wanted to have feedback from review. I am a rest ...
0 votes
1 answer
53 views

Code to save account details and register based on payload

I have this flow for registering a user. They send an empty user account no to get a temp account no which then they use for verifying the OTP by email and phone. Both done they should register ...
-1 votes
1 answer
74 views

is my code protected against SQL injections?

im using spring boot and CrudRepository for my queries, the project is about posting content on a blog, so I have a post record with id, creator name, post name, the content itself likes and dislikes: ...
2 votes
1 answer
109 views

Action argument supporting multiple units as string

I've got a controller with two actions that need to support two units: hours & times. The url should read like this: ...
1 vote
1 answer
62 views

A test class for a REST application

Here's a suite of integration tests for my REST controller. Among other things, it reflects my efforts to reduce code duplication First, I introduced some class fields. ...
-1 votes
1 answer
106 views

Using JavaScript to interface with REST APIs

The website TryHackMe came up with a challenge that involves using HTTP requests to interface with REST APIs (here, task #14/day 9). The challenge basically involves querying a basic REST API to ...
1 vote
2 answers
169 views

Search/Query API cross parameter check

Background I was working on a coding challenge as part of an interview process. I had to create a REST API where the user can report sensor data and query derived metrics based on several filter ...
4 votes
1 answer
93 views

Spring REST Endpoint for Saving a User Inquiry

Here's a piece of code from codebase I maintain/contribute to. It is a Spring REST controller, which exposes an endpoint to create user question. The question consists of title, description and ...
6 votes
2 answers
921 views

Python script to get and save data from a web API

I'm working as a system administrator (sort of), but learning Python on the side. Life gave me a chance to apply that knowledge, since our organization is being provided cloud email service, and it ...
3 votes
2 answers
407 views

Adaptive REST api rate limiter

I'm building a java client interacting with a server that returns responses with rate limit info in the headers: rate limit per period (for instance 10 per second) remaining limit left until next ...
4 votes
3 answers
515 views

Auctionsite API Wrapper in Python

This is the first API wrapper I've written and I'm wondering what I can do to improve. I've read through the feedback of a few similar posts Readme Code ...
1 vote
0 answers
870 views

Timeout middleware in Gin -Golang

This is an implementation of a custom timeout middleware. I am creating a context with a deadline in my middleware and using it in the rest handlers for timeouts (to wrap the query to DB eventually) ...
5 votes
2 answers
6k views

Rest API for realtime statistics of last 60 seconds

The following code is my solution to a code challenge I submitted a few weeks ago. I got rejected straight away with no feedback and I've wondering why. I'm interested in hearing if there is any ...
2 votes
1 answer
149 views

Merges two OKHTTP responses into one

The first request is sent asynchronously, then the id value is taken from the response to the first request and used in the second asynchronous request. And then both responses to request 1 and ...
0 votes
0 answers
842 views

ResponseEntity return json object

...
0 votes
2 answers
103 views

React Native screen to add a city to a weather app using a REST API

In a recruitment process, the company gives me a project to do in react native. I finished all the tasks. But company gave me a feedback and said that your project was good, but you did not apply best ...
2 votes
0 answers
174 views

Python REST API Data Extraction with requests library

Is there a better way to write this piece of code to extract data from a REST API with the requests library? It currently takes about 10 minutes to finish extracting the data from the REST API. I ...
6 votes
1 answer
216 views

Curl-based REST Client Library (round 3)

This code review request relates to this code review which covers the basic single REST call use case in this REST client library. This code review covers the classes and unit tests for the multiple ...
1 vote
1 answer
299 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 ...
0 votes
1 answer
114 views

Python API testing

I have written a rudimentary code in Python: That reads the API collection from Swagger/Postman and extracts the payload, link, and method It creates the response with the token(Generated from the ...
6 votes
1 answer
186 views

Curl-based REST client library (round 2)

This is a second iteration on an earlier review - cURL based REST client library I have done some refactoring to split out the REST HTTP response into it's own class from what was in the previous ...
1 vote
2 answers
348 views

Requiring query field to not be empty on search api

we have a RESTful API that includes an endpoint for search apiserver/v5/search?q=[search text] for any query, it passes it off to solr and returns the result like ...
-1 votes
1 answer
100 views

Basic ASP.NET Core RESTful API with Entity Framework Core

This is my first WIP backend asp.net application, which I will pair with react to create a full stack app. The thing I'm mostly worried about is model conversion to DTO and custom policy authorization,...
2 votes
1 answer
179 views

What is the common API endpoint architecture using DTO?

Hey I always used to create some pretty messy endpoints and I decided that it's about time to start writing cleaner code, I'll provide an example of how would I design an endpoint and I'll be ...
2 votes
1 answer
1k 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 ...
0 votes
2 answers
574 views

Python RESTClient Class with asyncio and aiohttp

I've seen Using asyncio and aiohttp in classes but could not really figure out how to apply this to my own code. The main idea of this code is to inherit from this RESTClient class whenever I build a ...
4 votes
1 answer
105 views

WordPress contact form plugin PHP and WP_REST improvements

TL;DR This month I wanted to improve my WordPress knowledge and create a simple form that wasn't bloated with features but was secure. I wanted to make sure this plugin improved my knowledge of: ...
2 votes
0 answers
62 views

Copy images using curl to make API calls

I am a junior web developer currently doing my first internship and I had a lot of freedom to solve small problems the way I thought was best. (There aren't really any developers here so I am ...
4 votes
1 answer
28k 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 ...
2 votes
1 answer
64 views

Wanted to eliminate the repetition in the classes created to reduce duplication

Can some one help me on how to eliminate repetition to reduce duplication score on the below classes created in the code ...
1 vote
1 answer
3k views

Handling multiple optional parameters in Spring

I have an endpoint in my RestAPI which can receive 3 optional parameters and then find information in the database with these parameters, also it is possible to combine the parameters. So, in my ...
4 votes
0 answers
480 views

Simple RESTful counting API in Golang

Description This is a simple (and hopefully) RESTful API in Golang that uses Redis. I have next to no prior experience in Golang and absolutely no prior experience with Redis. The API is a simple ...
4 votes
1 answer
103 views

Single end point REST API

I want to ask question about a better way for implementing single endpoint REST. I want to build a rest API but I want it to only have single endpoint like: graphql,...
4 votes
1 answer
2k 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 ...
4 votes
0 answers
172 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 ...
1 vote
0 answers
883 views

Python Rest API user registration based on FastAPI framework

I have written an API for a dating service. This part is related to user authentification, authorization, login and etc. It uses FastAPI, which in turn is based on starlette web server. You may wonder ...
4 votes
1 answer
280 views

Perl wrapper library (written using Moose) for a REST API

I wrote a wrapper library for a REST API in Perl using the Moose library. I would like to gather some feedback on it (mainly on the OOP part since I am new to moose), before pushing it out. Base ...
3 votes
1 answer
186 views

Golang Rest API

I want to ask if there is a better way to arrange this. Main concern is whether the store is set up in a good way and if passing Pointer to ProductRepository is a good idea or there are better ways ...
2 votes
2 answers
262 views

API call return type and error handling [closed]

I wrote the following method which would just call an API which would then update a user's subscription to something. ...
1 vote
0 answers
60 views

Basic REST API in Ktor

I have written a basic REST endpoint in Ktor and would like some pointers. Application.kt ...
4 votes
1 answer
782 views

Historical Funding Rate Miner for ftx.com

I recently started to take a look at the Go programming language and decided to write a small project without practical use. The objectives were: Regularly poll the latest funding rates from https://...
4 votes
2 answers
124 views

Application to calculate scores of strings submitted to an endpoint

Recently submitted a code assessment and I was wondering what other's feedback might be. What red flags can you see? I included gradle file if you're interested in running the application locally. ...
2 votes
0 answers
712 views

mongodb RESTfull api in python using fastapi and mongoengine

So I wrote a a RESTfull api for a mongodb with python3.7, fastapi and mongoengine and id love to get feedback on how I should make my code more readable, clean, and dry. basically there are 4 main ...
2 votes
1 answer
139 views

Stock data REST API extractor with GCP storage options

I'm currently working on an AI-driven trading system, the code below aims to extract ticker data from polygon REST API, this is a paid service so, in order to test the code you will need to subscribe /...

1
2 3 4 5 6