Category "rest"

Upload image to java rest api from .net http client

I am student and on a assignment i was trying to send image from my blazor page to java rest api . As for the api it works perfectly as i tried it with postman

Error instantiating servlet class org.glassfish.jersey.servlet.ServletContainer

Hi Trying to write a simple rest webservice. And following the tutorial below: http://www.tutorialspoint.com/restful/index.htm But i am getting HTTP Status 500

When collecting data with Modbus protocol through kafka Producer, collection stops after a certain period of time

I have deployed a Kafka cluster on a GCP instance. I used the connector through config/connect-distributed.properties. Start collecting data through restapi usi

MissingMemberHandling.Error force exception when deserializing the HTTP body

I am creating a restful web-service using .net and Newtonsoft for serialization/deserialization. The aim is to force exceptions (preferably HTTP 400) when a re

mongoose Model.create function returns undefined

The above query returns a 200 when I try to create a User, but whenever I log into MongoDB there is no collections created. Can anyone help ? //user model co

How to serve MP4 using an express Rest API server so it's compatible with mobile?

I have an express rest API server, and I am trying to use it to get an MP4 file from an S3 bucket and serve it. The video is displayed OK on my desktop, but doe

How to write Unit Test for below Exception Handler method using mockito?

@ExceptionHandler({ ConstraintViolationException.class }) public ResponseEntity<Object> handleConstraintViolation(ConstraintViolationException ex, WebRequ

Django testing rest-framework: APIRequestFactory vs APIClient

Being new to testing i'm looking to test my API in Django (Django-rest-framework). I'm setting up tests for my views, that is my API endpoints. Now looking ov

How to load a rest store with ID in Sencha Touch 2.4.2?

Here within a controller I create a rest store: this.somePerson = Ext.create('Ilhan.store.Human', { model: 'Ilhan.model.Human', autoLoad: false }); this

What's the most appropriate HTTP status code to return for connection failures on the server

What's the most appropriate HTTP status code to return for connection failures on the server? For instance, if the server fails to establish a connection to the

How do I use django rest framework to send a file in response?

I need to send a pdf file and some other parameters in response to a get API call using django rest framework. How can I do it? I tried this but it gives an er

Python requests not sending {"Content-Type":"application/json"} header or is just ignoring body in HTTP POST

I'm writing some Python to communicate with an API, that uses RESTful. I've managed many successful GET commands, however, am having difficulties with POST. The

Error occured Invalid payload provided. No JSON object could be decoded Coinbas

I having been battling this error for weeks now, read hundreds of resources that has just proven futtile and contacted coinbase support without getting any resp

Is base64 encoded image uploading a bad practice?

Is there a problem to use base64 encoding to upload (only upload) the image to the server? Considering the common image size of around 1-2 MB, not icon sized im

Pass data to sling model

Is it possible to pass a string or data that is retrieved in an Ajax call to sightly html? I have a 3rd party response in Ajax but I am trying to make the html

RESTful API resource returns 404 when added @QueryParam

My resource worked fine till now. I added @QueryParam there. If I make request without writing query param to uri it works fine. After I write query param to th

how to send variable along with the redirection in nodejs?

#Following in my code for redirect along with variable in nodejs app.post("/newcall", function(req, res) { var f = (req.body.try); console.log("val"+ f) r

How to deal with model changes in Django Rest Framework?

This is not a question for a particular use case, but for something I noticed in my experience doing APIs, specifically with using Django and Django Rest Framew

last_login field is not updated when authenticating using Tokenauthentication in Django Rest Framework

I'm working in a project which relies in a Django User model and TokenAuthentication under DjangoRestFramework I was requested to get last login datetime for e

Graphql and round trips. Is this just an ios app issue?

I'm taking another look at graphql, and I'm trying to understand why saving round trips is a benefit to developers. Is the cost of making a request so expensive