Questions tagged [rest]

35343 questions
1

votes
0

answer
135

Views

How to prevent WCF service from wrapping CDATA in response?

I have created WCF method which return C# object as response. Now the problem is that while I am posting request to this method using chrome postman I am getting JSON response and some of parameters are wrapped with CDATA. For example, One of parameter URL has value like 'http://www.examplewebsite.c...
Sanjay Parmar
1

votes
0

answer
57

Views

How to retrieve user shares

We have a working app that we're hoping to extend to include querying of personal shares via the linkedin rest api, using https://api.linkedin.com/v1/people/~/shares Our app has the following scopes provisioned in the developer console (and we're providing these in the auth request): ['r_basicprofil...
Greg
1

votes
0

answer
46

Views

Sort and set REST API data into a new list

I'm trying to create a report table based from an API, but the API currently is not sorted as I wanted it to be and I'm not sure how to rearrange it. Here's an example of how the API that look like this : [ { 'task': { 'id': 2, 'name': 'Texturing', }, 'assign_to': { 'id': 1, 'official_name': 'Roy Ha...
M.Izzat
1

votes
0

answer
189

Views

Getting a 403 Forbidden Error while uploading a document using SharePoint 2013 REST API

I am working on a task to generate an on demand spreadsheet/document and upload the generated document to SharePoint 2013 (on-prem) from .net core 2.0 application. I am using Epplus.core libraries to generate the spreadsheet. Using CSOM is not an option for me as I didn't find any nuget libraries wh...
Naveen
1

votes
1

answer
159

Views

500 error when making API token request to cherwell

I'm getting a 500 internal server error when trying to access cherwell REST api via Code trying to return a token to make other calls. I've verified that all the information (username, password, ClientID, and client secret) are all correct. I've also verified the server is up and accepting requests....
funktail1989
1

votes
1

answer
41

Views

Nested Relationship Serializer Rest Framework Not Displaying Properly

I'm trying to display the attributes in the Disease Model and Evidence Model, but the attributes that is displayed on the end link are only those attributes that are present in the Rule Model. Models.py :- class Rule(models.Model): disease = models.ForeignKey(Disease, default=0,related_name='DRules'...
mutedeuphonies
1

votes
1

answer
244

Views

unable to download the static xml file using spring Rest Controller

Here is my code snippet when i test it from postman, getting the file content but i am expecting file to be downloaded as opening window . @Override   public ResponseEntity downloadXmlFile() {     try {        String FILE_PATH =new ClassPathResource(ApplicationConstants.my_xm...
Nag-Raj
1

votes
0

answer
76

Views

Which database schema should i use?

I am building a Rest Api using node, MySQL and MongoDB, but i am confused with the database schema to go for as the business case is B2B and for each business(customer) there is like 10 tables for general ledger, products, transactions, clients, sales, purchase and many like these. and for accommoda...
Suraj Malviya
1

votes
1

answer
12

Views

Django should I manage users in a separate startapp?

In Django 2.2, if I plan to make authentication its own service in the future and serve requests through DRF, should I put my User model in a separate app from my regular 'functional apps'? There's no way each app should contain its own implementation of auth, right? Project_Root |--app_auth |--app_...
0

votes
2

answer
11

Views

how to receive username with token by django rest authetication?

I am using django Django=2.1.7 and rest framework djangorestframework=3.9.2 This is my url for login path('rest-auth/login', include('rest_auth.urls')), When I enter username and password I got the token from rest API. But I want my user detail like name, id etc to show in my react components. Pleas...
imsaiful
1

votes
1

answer
285

Views

JAVA - custom error response for invalid data

I wrote a post controller to handle a date from JSON request. Right now, for invalid dates, it returns a general 500 error without description. (i.e 'statusDate': '2017-13-27') How can I return a custom error message instead of a general one? (i.e 'Invalid date in 'statusDate' ') This is the code:...
Dvir
1

votes
0

answer
319

Views

adding product using woocommerce rest api too slow

I am trying to add a WooCommerce product from one Wordpress site to another using WooCommerce Rest API with NodeJS module. https://www.npmjs.com/package/woocommerce-api It takes more than 2 minutes to add only 10 products I need a solution for this I think it should take just 1,2 second at most to...
Abdelrhman Elgreatly
1

votes
0

answer
401

Views

Unable to send Activation Email with Djoser in Django Rest Framework

am trying to send activation email when a user get registered . when post request is called the content of email is shown in console but it is not send to user email. Django setting : EMAIL_USE_TLS=True EMAIL_HOST='smtp.gmail.com' EMAIL_HOST_USER= EMAIL_HOST_PASSWORD= EMAIL_PORT=587 EMAIL_BACKEND =...
Bishnu Sharma
1

votes
0

answer
52

Views

Providing an AppID, and AppSecret when building a REST API in NodeJS and MongoDB

I am building a REST API using NodeJS and MongoDB, and one of the features of REST API's that are made available for developers (e.g. Facebook, Twitter, Google etc) is to generate a unique AppID, and App Secret when developers register with your API on your site. What I would like to know is how do...
syedfa
1

votes
0

answer
136

Views

JWT authentication and permission_callback

In angular, I have following to get the JWT token for wordpress. import { HttpClient, HttpHeaders} from '@angular/common/http'; ... logIn(){ let loginInfo ={ username: 'admin', password: 'password.' }; let headers = new HttpHeaders(); headers.set('Content-Type', 'application/json'); this.http.pos...
steve Kim
1

votes
1

answer
95

Views

Multiselect in list or datagrid

Is there any way currently to select items and apply an action on multiple items in a list or datagrid? Datagrid has options for selecting items even multiselect but i can only manage to get the relative indexes of the items in the current list not the data objects. I could create an action to look...
twDuke
1

votes
1

answer
403

Views

Define MongoDB Collection in REST API GET Request

I have data in 2 seperate collections stored in the same MongoDB database. Is there a way to define in the HTTP GET request query string from which collection the data should be retrieved. I use the following JS to process the query: const findDocuments = function(db, callback) { const collection =...
Sebs030
1

votes
1

answer
88

Views

MockMvc - calling a query with a complicated object

I want to send to the controller a complex object consisting of files and simple types. public class ContributionNew { private List elementsToAdd; private Map elementsToUpdate; private Set idsToDelete; private Set sources; private String comment; } public class Photo extends MovieInfoDTO { private M...
sfsdfgdsg
1

votes
0

answer
84

Views

In WSO2 ESB when to use REST API and proxy service

In WSO2 ESB what is the difference between REST API and proxy services and when do use each of these.
VIKRAM
1

votes
0

answer
42

Views

How can we use the same Resource with different filters?

I have this Resource: And I need to show exactly the same resource but filtered by one of its fields (i.e. type === 'printer' by default, filter being hidden), so that we create a 'Printers' CRUD for the Assets: How can we send a 'custom' parameter to the Resource and use this for fetching the resou...
user2078023
1

votes
0

answer
198

Views

InvalidToken Error when using Rest API for Downloading file in an S3 AWS bucket in Android

I am trying to use the Rest Api with temporary credentials to download images stored in an S3 bucket in AWS from my Android App. I need to use the rest API instead of the TransferUtility method included in the Android AWS SDK, because I want to use an image downloader for better performance. Accordi...
xyz
1

votes
0

answer
388

Views

How handle correctly HTTP Accept header when is either empty or null?

I am working with Spring Framework about Rest. I have the scenario about testing when the request is a GET and Accept is either empty or null. It is closely related with: @GetMapping is called even when Accept is defined how null I have read the following: How to interpret empty HTTP Accept header?...
Manuel Jordan
1

votes
0

answer
28

Views

How to model users in the system?

I am working on system that will manage orders. Orders can be created via admin or via customer. Employee can take orders and change it's status. My system should have three global types of users: Admin - this type of users mostly uses WEB interface. Admins have different access levels, so some of t...
Aleksey Dolgiy
1

votes
1

answer
523

Views

Rest Assured API difference b/t param() and queryParam()

I am using Rest Assured API Automation framework for API Testing and can anyone tell me difference between the methods param() and queryParam() which we use in get() and POSt() request.
Jawad K.
1

votes
1

answer
217

Views

Securing SpringBoot REST endpoints in Google Cloud Platform

I created a SpringBoot application with a couple of REST endpoints and deployed it to Google App Engine Standard. Everything works fine and I am able to hit the endpoints. Now I want to secure these endpoints and allow only users authorized as admin to be able to call one of the endpoints. I tried...
AndoverDev
1

votes
1

answer
79

Views

Using GraphQL strictly as a query language

I think that my problem is a common one, and I'm weighing the costs and benefits of GraphQL as a solution. I work on a product whose data is stored by a monolithic CRUD-based REST API. We have components of our application expose a search interface for data, and of course need some kind of server-s...
lyonssp
1

votes
2

answer
542

Views

How can I add parameter to a stubbed response body in wiremock?

I'm using wiremock to stub the response of a dependent service. I need to use real data, because my system needs that data to properly do its job. I have a json that contains the stubbed response for an API call. It looks like this: { 'request': { 'method': 'GET', 'urlPattern': '/path' }, 'response'...
AlexD
1

votes
1

answer
1.9k

Views

java.lang.IllegalArgumentException: URI is not absolute Error in spingboot application

I am trying to call an App1 from App2. Both are in springboot and are hosted in Cloudfoundry. I am getting the below error while doing the process. java.lang.IllegalArgumentException: URI is not absolute But when I call the App1 from postman it works perfectly. Also when I call App1(at cloudfoundry)...
Tulsi Jain
1

votes
0

answer
24

Views

Minor Issue: Where is the better place to put User.objects.create_user in DRF?

Recently, I have reviewed my previous codes in Django thoroughly line by line. And I've got a minor issue. I have a preference to put ORM method to VIEW, not serializer. For example, I would like to make User.objects.create_user into APIView class like below. class SignUp(APIView): def post(self, re...
namwoo
1

votes
1

answer
80

Views

Passing REST URL parameter as query condition in Mongoose

Newbie in nodejs/mongoDB here. I've tried, with no success, to find the answer to my problem before posting here. I'm creating a simple node RESTAPI get services with Mongoose. I'm trying to pass the field value of the collection to retrieve a specific document. Like this http://localhost:3000/in...
bmdinesh
1

votes
0

answer
245

Views

Keep Alive Timer called close() error between jersey servers, using TLS

I have a multimodule Jersey project, where at some point in serving a request a Gateway module will talk to another Gateway module (this is the 'service discovery' part of the communication) on another PC. This communication works well, but when the code execution gets to the next request where thes...
Zoltán Umlauf
1

votes
1

answer
101

Views

How to search product on basis of it's attribute via api for woocommrce?

I have been searching product on basis of their attribute by the refference of woocommerce v1 api documentation.following is the sample code that i tried $args = array( 'page' => '1', 'status' => 'publish', 'attribute' => Array ( 'name' => 'Color', 'options' => Array('Loft Gray') ) ); $getProducts...
Pranav Patel
1

votes
0

answer
45

Views

stock exchange with API (bitfinex) and a phone

I have a little experience in developing, so could you help me by showing the general idea. There is a stock exchange with API (bitfinex). 1) So I need to monitor some data with as little delay as possible. I don't need to do any 'heavy' calculations. 2) A sound signal on a mobile phone (Android os)...
C0L0mb0
1

votes
0

answer
203

Views

Converting a table from html file to pdf using xhtml2pdf

Hi guys I am having a problem using xhtml2pdf. I am following a tutorial and it worked (note: the data in the tutorial is hardcoded). So I change a bit of the code from the tutorial so I can fetch data from a database using django-rest-framework. When I run the project there were no errors but I typ...
Eak321
1

votes
0

answer
170

Views

Access data source thru Power BI gateway

We have a need of accessing a data source from Power BI service using the push data set mechanism. As the data source resides on a private network, the idea is to set up a Power BI gateway providing us direct access without opening up the network firewall. Now, we see that the PBI gateway offers a...
Jerry Karlsson
1

votes
1

answer
325

Views

Authenticating into Wordpress from an Android WebView

I'm currently working on a hobby project that has 3 main components: an Android app, a Django-rest-framework based backend, a Wordpress frontend The Android app authenticates against the REST API, and also supports logging in with Facebook. There are some sections of the WP frontend I'd like to in...
alxrcs
1

votes
2

answer
65

Views

What is the best way to communicate authorization between a client and REST API?

I'm developing an application will use AngularJS for the front-end, communicating to a REST service on the backend, implemented as J2EE/Spring. The back-end services are secured through role-based authorization. In the front end of the application I would like to have the UI only allow users to per...
roxyblue
1

votes
1

answer
169

Views

GET img/png with grails.plugins.rest.client.RestResponse

I am using grails.plugins.rest.client.RestResponse to GET a binary resource of content-type png from a rest endpoint. import grails.plugins.rest.client.RestBuilder import grails.plugins.rest.client.RestResponse String url = 'http://localhost:8080/rest-endpoint/image.png' RestBuilder rest = new Rest...
user8840545
1

votes
0

answer
144

Views

HK2 Custom InterceptionService to intercept REST endpoints not working

I have below sample jersey application, where i have used HK2 to intercept rest endpoints having custom annotations to validate header. But it seems REST endpoint is never getting intercepted While debugging i could see the endpoint class is not scanned by MyInterceptionService class. @Target({Elem...
Raghu
1

votes
1

answer
64

Views

how to get url link on the response of get() method

I am trying to upload and get a response to an image using DRF api. the images are uploaded on the specified location but what i want is to get the link of the image so that i can click on it and could see the image when i get the response. if anyone could help me rectify this problem I would reall...
abhinavsharma1494

View additional questions