Stack Exchange Network

Stack Exchange network consists of 174 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
0answers
11 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
24 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 ...
0
votes
1answer
49 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
0answers
21 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
53 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
55 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
71 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
43 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
47 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
71 views

Python script to query REST API and write to database

I wrote the following sample script for learning purposes: ...
1
vote
0answers
47 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 <...
1
vote
0answers
355 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 ...
-1
votes
1answer
46 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 ...
2
votes
0answers
79 views

A RequestService for making REST requests

In my app I have a RequestService for making requests to the external API. It works fine, but I want to know if there can be improvements. The RequestService returns the type ...
0
votes
0answers
28 views

I have three classes which all make API requests, how can I refactor their similar methods?

I'd first off like to apologize if this is the wrong place to post this question, but I figured that code review would be the most relevant place (compared to stackoverflow and softwareengineering). ...
0
votes
1answer
402 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
3k 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
257 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
118 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
112 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
310 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
94 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 ...
0
votes
0answers
45 views

Implementing storage with MongoDB

I need to write REST interface to MongoDB. Help me please to improve the architecture. The program's main goal: respond to HTTP requests, store big files in Mongo, send file metainformation, etc. I ...
0
votes
0answers
547 views

Uploading files asynchronously in Swift using Alamofire

I recently began a tutorial to familiarize myself with uploading content to RestAPIs via Alamofire. I've a habit during tutorials to try and clean up the code as I go along to better drill in what the ...
0
votes
0answers
130 views

Check PHP cURL script should work as required

I recently messed up and uninstalled some dependencies for a server that are a pig to get back. I think it's going to be easier and quicker to replace the package with cURL instead. Could someone ...
3
votes
3answers
57 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
231 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 ...
4
votes
1answer
132 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
241 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
200 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 ...
0
votes
0answers
63 views

.NET API Layer for Freshservice

Below is an class to act as API Layer for the Freshservice APIs. Here's their docs: https://api.freshservice.com/ Aside from some much needed comments, what issues do you see with the implementation?...
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
74 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
115 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
629 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
404 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
421 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
123 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
330 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
248 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 ...
1
vote
0answers
3k views

Pagination using Spring MVC and Hibernate

My company develops a Spring web application that exposes a REST API and right now we're starting to look into pagination for the methods that load data from some heavy tables. We initially looked ...
4
votes
2answers
158 views

Request dispatcher for PHP JSON web service

Below you can find the constructor method and related fields of the main class of my REST API (note that the class contains more code than displayed) written in PHP 7.1. It does various things with ...
0
votes
1answer
561 views

REST API design using spring boot

The following API caters to CRUD operations on users and their corresponding filters (kind of rules). These filters are applied on incoming data from various sources basing on user and then a variety ...
1
vote
0answers
51 views

Determine serializer on per-action basis for DjangoRestFramework ModelViewSet

I have a Profile object with two fields. One is safe for the public to see, while the other contains private data. ...
1
vote
0answers
26 views

Retrieving the count of users with complete and incomplete profiles

Problem I have to display the count of total users with Incomplete and Complete Profiles. Incomplete Profiles are those which will have 4 fields of String type. ...
2
votes
1answer
48 views

Generating Report Data in CSV format for various cases

I have to show report data for various cases in text-csv format as soon as the user click's on the given URI's. The given cases are: End_Customer Data Incomplete Profiles. Total Connections Below ...
1
vote
0answers
679 views

Adding support of HTTP PATCH

I have an API endpoint to modify a race car, which supports the PUT method: PUT /api/racecars/{racecarId} Since PUT must be ...
1
vote
0answers
252 views

Django Rest Framework model relations for a Gallery app

I'm creating a school project, a Gallery app. I have the following entities: Profile, Album, ...
7
votes
1answer
131 views

A PHP API which has an endpoint for processing a user's facebook login details

I'm working on a PHP API for my angular JS Phonegap application. At the moment I'm focusing on working with a user's facebook public profile data. I'll explain the process a little first: The user ...