Questions tagged [unirest]

Unirest is a set of lightweight HTTP libraries available in PHP, Ruby, Python, Java, Objective-C.

Unirest is a set of lightweight HTTP libraries available in PHP, Ruby, Python, Java, Objective-C.

More Details

354 questions
2
votes
0 answers

Unirest request returns an 404 error with a valid URL

I'm having a problem with a Unirest request returning a 404 error with the URL below: http://newseg.evoluma.com/publico/login/?access=prefblumenau&&json=true&&type=2 When I use the browser to navigate to this URL everything runs as it meant to be,…
PauloArais
  • 21
  • 3
2
votes
1 answer

What is the difference between UniRest and Spring RestTemplate giving an http 400 Bad Request?

What is the difference with UniRest and Spring RestTemplate which is giving back a 400 Bad Request with apparently the same header and body sent ? I try to reach the HubSpot API to create a BlogPost, but using RestTemplate I have a 400 Bad Request…
2
votes
2 answers

Why am I getting "java.lang.NoClassDefFoundError: kong/unirest/Unirest"?

I'm creating a Java application that does a POST action. I need to do a HttpRequestWithBody to send a JSONObject. I'm using Unirest to accomplish this task. While debugging the program stops at the line that creates the request and asigns the…
ParticleDuality
  • 139
  • 3
  • 13
2
votes
0 answers

create a jenkins job using unirest

I can't create job on jenkins using Unirest File file= new File(mypathFileConfig); HttpResponse checkResult = Unirest.post("http://"+userNameJenkins+":"+tokenJenkins+"@"+UrlJenkins+"/createItem?name="+jobName) …
2
votes
2 answers

Unirest howto log request and response in Java

I just started using Unirest REST framework which is great but don't see anywhere option to intercept and log full request and response with headers and body. Does anybody know how to atchieve it?
jan
  • 53
  • 2
  • 4
2
votes
2 answers

Unirest gives NoSuchMethodError when using asString method

I am trying to do a simple get to an endpoint and get the response body as and HttpResponse using the asString() method. The code compiles, but bugs out at runtime saying there is no such method error. I imported Unirest into my maven build and I…
2
votes
1 answer

What are the pros and cons of Unirest over RestAssured for API testing?

I have used rest assured before and not aware of unirest much. Does anyone used both and can tell me which one is better to automate rest APIs
Poornima Hegde
  • 163
  • 1
  • 10
2
votes
2 answers

How to get response from unirest nodejs POST call?

I have used the following code sample to call a API which returns a access token. var responsedata = ''; unirest.post('http://sandbox.com/api/getToken') .headers({'Content-Type': 'application/x-www-form-urlencoded'}) …
Ahmed Reza
  • 23
  • 1
  • 4
2
votes
1 answer

Get url to which bitly short-url redirects with HTTP Request using Java

I have short-url bit.ly/18SuUzJ that leads to stackoverflow.com/ Do you know how to get that url using HTTP Request with Java? I added Unirest to maven dependencies and tried sth like: HttpResponse response =…
AAlechin
  • 31
  • 3
2
votes
1 answer

Getting Failed resolution of: Lorg/apache/http/impl/nio/reactor/DefaultConnectingIOReactor When trying to implement a Unirest API from RapidAPI

I am trying to implement the Spoonacular Api from RapidApi with Android. It uses Unirest so I am trying to configure it. On the official documentation I am following the Without Maven section. I downloaded the unirest jar and I have these in my…
h_h10a
  • 449
  • 5
  • 18
2
votes
1 answer

nodeJs - post request with form-data using Unirest

how can I post a file(please refer my screenshot) with unirest in node.js. I have gone through unirest doc it's found that can use the below code for sending form-data to a given…
basith
  • 740
  • 4
  • 13
  • 26
2
votes
1 answer

Mapping a class to a unirest object and displaying response data

I am trying to display and map a response to a class from Unirest with .NET. I have followed this example on stack: Convert the http response body to JSON format using Unirest C# However, when running it, I get an error "Unable to cast object of…
2
votes
1 answer

Unable to have Docker containers communicate with each other

I have two Docker containers, one running a React app (built using create-react-app) and another with a Node app API. I have a docker-compose file set up, and according to the documentation I should be able to use the names of the services to…
2
votes
1 answer

How to POST JSON + pdf file with Unirest in NodeJS

In NodeJS I am trying to POST JSON data to the server along with a file using the following code: unirest.post(url) .headers(headers) .send(data) .attach('file', file) .end(function (response) { var statusCode = response.status; if…
ralfe
  • 1,412
  • 2
  • 15
  • 25
2
votes
1 answer

Why is my return empty (Node.js, unirest)

I have a problem with my little Node.js test setup. I basically want an endpoint that I can call, and this endpoint can call different other endpoints and give me a JSON as a response. When I have a look at the console output of the performRequest…
Tom Meyer
  • 31
  • 3