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
1 answer

How to upload image on server using Unirest library

I am uploading image on server using Unirest library, but getting error like {"code":400,"message":"Unknown content type [contentType=application/octet-stream]"} My code is Unirest.post(url).header("Content-Type", "multipart/form-data") …
Sanni Raj
  • 127
  • 1
  • 9
2
votes
1 answer

Python Yandex translate example

so for example I am trying to use unirest for this so i put base = 'translate.yandex.net' post = '/api/v1.5/tr./getLangs?ui=en&key=' + api_key request = unirest.get(base+post, headers={'accept' : "json"}) and the code says something about not a…
killer
  • 372
  • 1
  • 5
  • 15
2
votes
3 answers

How do I instantiate an unirest HttpResponse for my mock?

Let's say I have a class called Api and it has a method: public class Api{ public HttpResponse request() { try { return Unirest.get("http://localhost:8080").header("accept", "application/json").asJson(); }…
Balazs Varhegyi
  • 991
  • 1
  • 18
  • 37
2
votes
0 answers

"python setup.py egg_info" failed with error code 1 while installing unirest through pip

I'm on Ubuntu 14.04 and have both python 2.7 and 3.4 installed in my system. I was trying to install python's unirest using pip. But it returns the following error. >> [sudo] pip install unirest Collecting unirest Using cached…
Sherbert
  • 23
  • 6
2
votes
2 answers

Invalid operation during the http request

I'm writing a windows forms app where user have to enter email address and I need to check if it's valid. I have found Mashape API but I get an exception; "An unhandled exception of type 'System.InvalidOperationException' occurred in…
Laguland
  • 65
  • 1
  • 7
2
votes
3 answers

jackson exception in unirest: Serialization Impossible. Can't find an ObjectMapper implementation

ObjectMapper mapper = new ObjectMapper(); ObjectNode object = mapper.readValue("{\"myjson\":\"string\"}", ObjectNode.class); HttpResponse postResponse = Unirest.post("") .header("accept", "application/json") .body(object) …
user1561108
  • 2,666
  • 9
  • 44
  • 69
2
votes
0 answers

Catching Uncaught exception Exception: SSL read

I'm reading a URL that is finicky sometimes and throws a Uncaught exception Exception: SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054 I tried doing this: try { $body = Unirest\Request::get($url); } catch (Exception $e) { print…
Mr A
  • 1,345
  • 4
  • 22
  • 51
2
votes
1 answer

Unirest for Java

I have a Python Script, which post data to a server url as below. I want to achieve this using unirest for Java. How do I add parameter/header values for a unirest post request in Java Python Script: url =…
sromit
  • 900
  • 3
  • 16
  • 43
2
votes
1 answer

How to upload a file in Telegram Bott api using Http client?

I have tried to send files using multipart form data, but all I get is the following error: {"description":"Error: Bad Request: chat_id is empty","error_code":400,"ok":false} Here is my code snippet. Can anyone help me out where I am committing an…
user2657708
  • 21
  • 1
  • 2
2
votes
0 answers

Fix dependency issue gradle

I am trying to use the unirest library in my android application, in order to use mashape.com. Unfortunately some unirest Apache dependencies conflict with some android Apache dependencies. The issue can be resolved by following this blog post…
DadFoundMy
  • 53
  • 1
  • 7
2
votes
2 answers

Error - Didn't find class "javax.naming.ldap.LdapName"

I'm using unirest to get a camfind result. The full error log : 04-14 18:24:39.574 1880-2300/projectco.project E/AndroidRuntime﹕ FATAL EXCEPTION: Thread-120 Process: projectco.project, PID: 1880 java.lang.NoClassDefFoundError: Failed resolution…
Dominus
  • 808
  • 11
  • 25
2
votes
2 answers

Could not find class `javax.naming.ldap.LdapName` referenced from method `com.mashape.relocation.conn.ssl.AbstractVerifier.extractCN`

I have the following example activity: package teste.myapplication; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.widget.TextView; import…
CatarinaPBressan
  • 132
  • 2
  • 13
2
votes
1 answer

Does unirest support python3?

Does unirest support python3? I have googled and zero information comes up. Even in the unirest documentation it does not say it is 2.x only which leads me to believe it supports both 3.x and 2.x. However the install fails with 3.4 and succeeds with…
Nicholas Kolatsis
  • 427
  • 1
  • 5
  • 9
2
votes
1 answer

Unirest post method doesn't work?

I have a very short code snippet taken directly from mashape: I've included the paths correctly, as follows: require_once 'unirest-php-master/src/Unirest.php'; And the code snippet to send a POST request: $response = Unirest::post("", array( …
blazonix
  • 393
  • 2
  • 5
  • 15
2
votes
2 answers

Unirest async request preventing the JVM from exiting

I'm trying to use asynchronous callbacks via unirest in Java. However, after switching from synchronous to asynchronous requests, the JVM doesn't seem to exit. I'm not sure what the thread dump is means either. I'm compiling & running this on JDK…
Null
  • 384
  • 2
  • 14