Questions tagged [httpentity]

68 questions
0
votes
0 answers

Could Http server return error code before POST body is sent?

If a Http server is not reachable, and Http client is trying to send a POST request to the server, will the Post content ever have the opportunity to be sent or no (say error code come back and the code will not be executed)? More specifically, I…
shirley
  • 1,640
  • 4
  • 12
  • 19
0
votes
1 answer

"no Content-Type found" : Issue when using RESTTemplate to POST to HTTP endpoint

I'm trying to POST a XML body to a HTTP endpoint with RESTTemplate, however the following exception is being thrown - "org.springframework.web.client.RestClientException: Cannot extract response: no Content-Type found". I have checked and the XML…
Matty
  • 21
  • 8
0
votes
1 answer

Retrieving binary file from post request

Sending a POST request (Apache httpclient, here Kotlin source code): val httpPost = HttpPost("http://localhost:8000") val builder = MultipartEntityBuilder.create() builder.addBinaryBody("file", File("testFile.zip"), …
osx
  • 146
  • 1
  • 11
0
votes
1 answer

Fetch the json from HttpEntity

I have an object of akka.http.scaladsl.model.HttpEntity looking like HttpEntity("application/json", {Myjson here}) Is there a way i can fetch my json from the entity without any string manipulations(other than converting to a string and doing a…
Nagireddy Hanisha
  • 1,290
  • 4
  • 17
  • 39
0
votes
2 answers

How do I modify the content of an HttpEntity

I've got an HttpResponse with an HttpEntity (all from org.apache.http). My HttpEntity has some application/json content that I want to modify before sending it forward. I can read the content as a string…
fdr
  • 119
  • 6
0
votes
2 answers

How to get String value from JSON Array?

I know this has been asked many times but none of the solution provided is working in my case. Here is my JSON which I am getting as a response from a webservice { "size": 1, "_links": { "context": "XXXX", "self": "XXXXXX", "base":…
Naseem
  • 911
  • 5
  • 18
  • 48
0
votes
1 answer

RestTemplate's postForObject Terminating Immediately After Sending Request

I'm trying to send a POST request with the following method, and return the HTTP response code upon sending the request. Code in question: private ClientHttpRequestFactory getClientHttpRequestFactory() { HttpComponentsClientHttpRequestFactory…
Christian
  • 41
  • 1
  • 3
0
votes
1 answer

Alternate method for Httpentity in OKHttpClient Library

I am trying convert HTTPClient method OKHttpClient, But i am not able to find the alternate method for HTTPentity and stringentity. Can Any one please help me to solve my problem. Thanks in advance.
0
votes
0 answers

How to remove slash from entity android

I'm trying to form a request param like…
Sangeetha
  • 496
  • 1
  • 7
  • 25
0
votes
2 answers

Alternative methods for HttpClient, HttpPost, HttpResponse, HttpEntity, etc in Android

I'm trying to make a login application that gets data from an online database. I've found a tutorial on the internet, but most of the methods are deprecated. So I'd like to know how I can find alternative methods for the deprecated ones. After I…
Marcos Guimaraes
  • 1,243
  • 4
  • 27
  • 50
0
votes
1 answer

To set ContentTypes or MediaTypes to `image/jpeg` in Akka

I'm trying to make a test in akka with Scala. I need to test if some image is ".jpeg". I my function, I've to see the ContentType -> MediaType. And in the function it's not a problem 'cause I get the image from the Computer, but to test I've to…
Chuck Aguilar
  • 1,998
  • 1
  • 27
  • 50
0
votes
1 answer

SpringMVC: Return Double in ResponseEntity

I want to send a number (Java reference type Double) in my ResponseEntity: @Controller public class ProjectController { @RequestMapping(value="/get/number") public ResponseEntity getNumber(){ Double resp = new…
SamRaxin
  • 1
  • 2
0
votes
1 answer

Exception in thread "main" java.lang.Error: Unresolved compilation problems: The constructor HttpHeaders() is not visible

i am trying to get data from a server and i need to show server certificate on for this work so i have included server certificate as below but iam getting below error: Exception in thread "main" java.lang.Error: Unresolved compilation problems:…
Labeo
  • 5,831
  • 13
  • 47
  • 77
0
votes
1 answer

Android HttpPost and HttpClient Substitute

Just a quick question. Until now I have been using HttpClient and HttpPost to post a file and some parameters to a php script on my server. However they have been deprecated. I was wondering what i could use to substitute it. I found some answers on…
0
votes
1 answer

Swift NSURLConnection put HTTP Entity

i want to put a HTTP Entity ( W3.org link ) extra using swift NSURLConnection. i put a Http Header named entity-body with my urlEncoded key value in NSMutableURLRequest but not working ! Edit var request:NSMutableURLRequest =…
Mojtaba Yeganeh
  • 2,788
  • 1
  • 30
  • 49