Category "rest"

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

Custom API and cunsuming in php?

I want to write Web services(REST) and Consuming using Curl in php. $books = array( "java"=>"222", "php"=>"333", "c"=>"111",

Django Rest Framework Postman Token Authentication

I am using Django Rest Framework Token authentication and if i do curl http://localhost:8000/api/v1/users/?format=json -H 'Authorization: Token 0a813fdcd3f8846d

JAX-RS jersey ExceptionMapper: How to know the method who threw the exception

Im using JAX-RS jersey ExceptionMapper, and I'm wondering if there is a way to know inside the method toResponse(), which method (from the API) threw the except

Spring Webclient block() method executing forever not returning value

I am working on oauth implementation, by following the https://developer.okta.com/blog/2021/05/05/client-credentials-spring-security It's a test client, I am ge

Example of DocuSign REST API EnvelopeAttachment: update?

Could someone please supply an example of the use of the DocuSign REST API EnvelopeAttachment: update request (PUT /restapi/v2.1/accounts/{accountId}/envelopes/

Django Rest Framework - prevent access to API?

I'm using Django Rest Framework and Token Authentication. Everything works great so far. http://www.django-rest-framework.org/api-guide/authentication#tokenaut

Azure DevOps: How to create a folder in GIT repo with REST API repo

I want to create a folder hierarchy in a GIT repository on Azure Devops using the REST API. (automated via a script) The docs https://docs.microsoft.com/en-us/r

How REST API handle continuous data update

I have REST backend api, and front end will call api to get data. I was wondering how REST api handles continuous data update, for example, in jenkins, we wil

How to get parameters from path in Bottle?

When i execute this url: http://domain:8081/forum?id=2&page=26 with this code: @route('/forum') def display_forum(): forum_id = request.query.id p

How to form protobuf resource part of http request body and test it through dhc client or postman for restful services

I have created a .proto message and I'm exposing a rest service which looks like this @Path("/test") public interface test{ @POST @Produces("application/x-pr