Latest Questions tagged Rest

Browse all latest questions tagged Rest

126
Votes
Published 14 Sep, 2022
Java - Design Pattern to model Request and Response Objects for Webservices

I have about 7 REST web services to implement. Some of these web services have a standard (identical) response, while some have different responses. The requests for these web services are different...

8
Votes
Published 16 Apr, 2022
Javascript - Client Server REST API captcha implementation

I'm building client server REST application. Client side is based on Angular while server is PHP (not that it matters much anyhow). What I am wondering if there are any best practices, good examples...

89
Votes
Published 07 Sep, 2022
Java - (Date) may expose internal representation by storing an externally mutable object into CategoryModel.createdDate

While working on model class i face an following warning :-- com.model.products.CategoryModel.setCreatedDate(Date) may expose internal representation by storing an externally mutable object into Cate...

66
Votes
Published 24 Aug, 2022
Python - REST API in Python with FastAPI and pydantic: read-only property in model

Assume a REST API which defines a POST method on a resource /foos to create a new Foo. When creating a Foo the name of the Foo is an input parameter (present in the request body). When the server crea...

52
Votes
Published 17 Oct, 2022
Java - javax.validation.constraints does not work with Spring web

Here is my controller: import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; @Slf4j @RestController @RequestMapping("/auth-api") public class AuthController {...

44
Votes
Published 23 Aug, 2022
Python - Authentication Failed - 'Authorization' header is missing - Python HTTP request to Azure

Please see the error below I am getting when trying to send a REST API PUT call to Azure. {"error":{"code":"AuthenticationFailed","message":"Authentication failed. The 'Authorization' header is miss...

131
Votes
Published 26 Aug, 2022
Python - How do I get JSON data from RESTful service using Python?

Is there any standard way of getting JSON data from RESTful service using Python? I need to use kerberos for authentication. some snippet would help.

85
Votes
Published 07 Sep, 2022
Java - JAX-RS query with multiple parameters of the same name

I want to make a web-service where you can query for generic data. So, my URL would be something like this: .../field_name/Country/field_value/US/field_name/City/field_value/Boston what would be th...

60
Votes
Published 02 Sep, 2022
Java - Reading HTTP headers in a Spring REST controller

I am trying to read HTTP headers in Spring based REST API. I followed this. But I am getting this error: No message body reader has been found for class java.lang.String, ContentType: applicatio...

29
Votes
Published 24 Apr, 2022
React - React frontend and REST API, CSRF

Using React on the frontend with a RESTful API as backend and authorisation by a JSON Web Token (JWT), how do we handle sessions? For example after login, I get a JWT token from REST. If I save it to...

99
Votes
Published 02 Aug, 2022
Jquery - Calling REST API from controller codeigniter

I am new to code igniter and for my project I have to create a REST API. I have a working REST API. What is the correct way to call the API from ajax calls? View -> Controller -> REST or...

21
Votes
Published 19 Aug, 2022
Python - FastApi communication with other Api

I am using fastapi very recently and as an exercise I want to connect my fastapi api with a validation service on other server... but I do not know how to do this, I have not found something that will...

10
Votes
Published 19 Aug, 2022
Python - Django management command arguments

I'm trying to understand how Django management commands work. When there's no argument, or self on it's own. my command works fine. When I add arguments to the second function 'def add_arguments' it...

59
Votes
Published 01 Aug, 2022
Python - Django rest auth user_logged_in signal

I have a django rest app using django rest auth. I'm trying to log something everytime a user log in using signals. I've searched on the web on how to use signals and I haven't found any interesting...

81
Votes
Published 17 Aug, 2022
Python - Python POST binary data

I am writing some code to interface with redmine and I need to upload some files as part of the process, but I am not sure how to do a POST request from python containing a binary file. I am trying t...