Questions tagged [apiclient]

Tag used for questions about APIs used in client-side applications.

59 questions
11
votes
2 answers

Django APIClient login not working

I'm having problem authenticating with my Django Rest Framework API in Unit Unit Tests. The system works as expected when accessing it through the browser. I however receive a 401 HTTP status when sending a put request to the following class at the…
mingles
  • 111
  • 1
  • 6
9
votes
5 answers

python install module apiclient

New to python, and trying to install a module "apiclient" since my ide pycharm does not recognize that import: from apiclient.discovery import build what I tried: pip install apiclient download manually the package from…
Nir Regev
  • 135
  • 1
  • 2
  • 7
8
votes
2 answers

Helper to create a dynamic Ruby OpenAPI/Swagger client to a REST API

I used Bravado to create a Python client to a REST API for the petstore. I need to do the same to get a dynamic Ruby client to the REST API. I saw a list of tools in the OS integrations Swagger page but most of them seems to be to automate tests…
user3313834
  • 7,327
  • 12
  • 56
  • 99
5
votes
2 answers

Query parameters in PUT call of APIClient

I have an API endpoint to which I want to make a PUT call which needs both a body and query parameters. I use Django's test client to call my endpoint in a test case (docs). I read in the documentation that for a GET call, query parameters are…
physicalattraction
  • 6,485
  • 10
  • 63
  • 122
3
votes
1 answer

Django APIClient Post Empty

I am writing a test for a post view. It does work, But when I try and post to it with APIClient.post, I get QueryDict: {}. Here is the test: class SMSCreateData(APITestCase): ... def test_SMS(self): ... postData = {'Body':…
SillyInventor
  • 113
  • 1
  • 11
2
votes
1 answer

Replacement for SearchSourceBuilder class in java api client

I am migrating a java application from elastic search high level client to java api client. There is a SearchSourceBuilder class in elastic search java high level client. But I couldn't find any corresponding class in java api client. Can someone…
Anamika
  • 75
  • 1
  • 8
2
votes
1 answer

Requesting Token from ADFS with AD Group Membership Info

I have a rest client application and I want to be able to get an access token from ADFS /token endpoint for that client. The client will be used by existing AD Users, and I want to get the Group Membership of the AD User in the access token. How…
EngelbertCoder
  • 777
  • 2
  • 9
  • 29
2
votes
0 answers

How to test image upload API using postman?

I have an Image Uploading API which I call from android and Its working fine.Now I want to test same API using Postman. Someone please guide me to test this API on Postman. What parameters I need to set in Postman to test this API. I have tried to…
2
votes
1 answer

Abstract classes on client generated code from swagger spec API net core

I have an issue with my errors base class on my api. I used this options to see it working on documentation. But when I use the swagger json to generate Rest Code on https://editor.swagger.io it generates the 3 classes, BaseException (abstract),…
ArlanG
  • 888
  • 9
  • 21
2
votes
1 answer

Inspecting a stopped docker container on python using inspect_container

I'm coding tests with python. I want to make a method that outputs the status of a container (running/exited). import docker class Container: def __init__(self, name, image, *, command=[], links={}): self._docker =…
2
votes
1 answer

python people api quit working

I have a python (2.7.10) code based on the "quickstart" example at https://developers.google.com/people/quickstart/python, which reads contacts from a gmail account. It has been running every Sunday for months. On 12/18/16, it failed. The error…
2
votes
1 answer

Java REST API CLient

I have java client that hits API which i have created but when i run the class which is basically java client then it throws exception. Here is exception. Exception in thread "main" java.lang.RuntimeException: Failed : HTTP error code : 405 at…
Hassan Shahbaz
  • 596
  • 1
  • 14
  • 38
1
vote
1 answer

How do I call a api client generated method with header/body params?

Given this API client class generated via swagger codege 3.0 # coding: utf-8 from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from swagger_client.api_client import…
MG9901
  • 7
  • 2
1
vote
0 answers

how to set headers that get from client api in Go

I have a client API where the client API has headers: req.Header.Set("Authorization", tokenBarear) req.Header.Add("Content-Type", "application/json") for token bearer which is set for the time limit. However when I run and test in postman it…
loops
  • 19
  • 1
1
vote
0 answers

ES7 Migration :: From Transport Client to API client

I know that there exists documentation for migrating ES7 clients from [TransportClient to HighLevelRestClient] and [HighLevelRestClient to API client]. But I want to check if it is possible to directly migrate from [TransportClient to APIClient] Is…
1
2 3 4