Questions tagged [httpclient]

Please refrain from using [apache-commons-httpclient], [apache-httpclient-4.x], [jetty-httpclient], [java-http-client], [dotnet-httpclient] or [angular-httpclient].

Having trouble sending data with a POST request using Angular 4's HttpClient?

Angular 4.4.4 This is an introduction to my app component constructor( private http: HttpClient, ) this.http.post('/api.php', {name, age}).subscribe(response => { console.log(response); }); api.php -> exit(json_encode($_POST)); No ...

Is it possible for Angular's `HttpClient` to use complex property types in the `.get()` generics aside from just `string` or `number`?

After spending an entire day researching the topic, I've hit a dead end. All my efforts have only led me to discover one thing—omission. None of the information I've come across mentions whether you can utilize non-simple types (such as string ...

Angular HTTP Requests with Observables

In order to enhance the security of my Angular web application, I am currently in the process of developing a TypeScript method that will validate a JWT token on the server using an HTTP call. It is imperative for me that this method returns a boolean val ...

Angular 10 encounters difficulties when attempting to execute HttpClient

I encountered an error when attempting to execute "ng build". The error message states: ERROR in node_modules/@angular/common/http/http.d.ts:81:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class. ...

Error: Angular version 5.1.0 is unable to set the header content-type to application/json for HttpClient

I have been attempting to customize the header for a POST API request to be of content type application.json. let options: { headers?: {'Content-Type':'application/json'} } Unfortunately, this customization is not being successfully a ...

"Exploring the process of implementing a fixed method POST in Angular 5

When developing an application for Portal, I encountered an issue where a newly created role is not displayed without refreshing the browser. How can I ensure that the added element is directly displayed in the table without needing to refresh the browser? ...

Generate HttpRequestHeaders using JObject

One of my challenges has been creating an API for my desktop software to streamline the process of changing HttpClient headers without having to constantly code and rebuild. My main hurdle now is figuring out how to generate a custom list of HttpRequestHea ...

Is there an alternative to RequestOptionsArgs that I can use in this function?

I am currently working on updating an existing Angular application from version 4.3 to Angular 8. One of the challenges I'm facing is replacing old component classes like ConnectionBackend, RequestOptions, and RequestOptionsArgs with their updated equivale ...

Can you provide me with instructions on utilizing the Apache HttpClient library for sending a PATCH request containing JSON data?

How can I use Apache HTTP client v 4.3.4 to send JSON data to a URL using the PATCH method? Here's what I've tried: // Create the httpclient HttpClient httpclient = HttpClientBuilder.create().build(); // Prepare a request object HttpUriRequest ...

Is there a way to set a custom port number for an Angular application?

I am currently in the process of constructing an Angular application. The application is designed to communicate with a server via HttpClient. However, each time the application connects to the server, it utilizes a different port. I am interested in confi ...

The Angular service uses httpClient to fetch CSV data and then passes the data to the component in JSON format

I'm currently working on an Angular project where I am building a service to fetch CSV data from an API server and convert it to JSON before passing it to the component. Although the JSON data is successfully logged in the console by the service, the comp ...

angular application encountering an error 404 with proxy redirection issue

I've been working on building an angular spring boot application. Below is the request I'm making: getListProduitImmobilierDTO(pagesize: number, page: number, search: Search): Observable<ProduitImmobilierDTO[]> { const headerDict = { 'C ...

Issue with sending headers in HttpClient.post method in Angular 8

I have successfully implemented the following code: this.http.post (TGT_IP,body, {responseType: 'arraybuffer'}).subscribe( (val) => { console.log("POST call successful value returned in body", val); }, ...

Angular 5 disregards subscription response data

Struggling with handling HttpClient get request responses in my Angular component. Despite having no compilation errors, I can't seem to access the response from the service. Take a look at how I'm calling the service method in my component: ...

Tips for transforming a JSON Array of Objects into an Observable Array within an Angular framework

I'm working with Angular and calling a REST API that returns data in JSON Array of Objects like the example shown in this image: https://i.stack.imgur.com/Rz19k.png However, I'm having trouble converting it to my model class array. Can you provide some gu ...

The Angular HttpClient is unable to retrieve the message from the response body

I am in the process of implementing a post request using HttpClient to send data to my getFeedback endpoint and display the response in my application. I have a codeService and a dashboard component. Here is the code snippet for the post method in my code ...

Exploring Angular4: Utilizing HttpClient with HttpParams for Passing Object Values in httpParams.set()

I'm facing an issue with handling a more complex key value pair. What if I need to set a value as an object? This is the problem I am encountering: const includeStr = JSON.stringify({include: 'match-timeline-events'}); const params: HttpParams = new Http ...

Error encountered during parsing of value in Json.net using C#:

Whenever I attempt to retrieve JSON data from a URL, I encounter the error mentioned above. public class Product { public int Id { get; set; } [JsonProperty("externalId")] public int ExternalId { get; set; } [JsonProperty("code")] pub ...

A comprehensive guide on using HttpClient in Angular

After following the tutorial on the angular site (https://angular.io/guide/http), I'm facing difficulties in achieving my desired outcome due to an error that seems unclear to me. I've stored my text file in the assets folder and created a config ...

What is the process of sending JSON parameters in an Android web service request?

Possible Duplicate: How to send a JSON object over Request with Android? Being new to Android development, I encountered an issue when trying to send requests to a web service in JSON format. After researching online, I came across this code snippet f ...

Guide on executing synchronous operations using httpclient

I am facing an issue where I need to make multiple HTTP requests but I am struggling to synchronize them. Here is the code snippet where I am trying to achieve this. I am having difficulty setting the cartId value from the HTTP service, although I can suc ...