cost 119 ms
身份驗證時出現 415 錯誤 - Spring 引導和 RestTemplate

[英]415 Error when authenticating - Spring boot and RestTemplate

我正在處理第三方 REST API,我將通過向提供的端點發出 POST 請求來驗證他們的 API。 我使用 Postman 測試了這個端點並且它工作正常,現在我想以編程方式進行。 我正在使用 Spring boot 3.0 進行開發,並使用RestTemplate作為 http 客戶端。 我已經實 ...

將文件從另一台服務器重新傳輸到客戶端springboot

[英]Restream files from another server to client springboot

我有 2 項服務 - 入口(輸入節點)和存儲。 客戶端在 Ingress 上發送請求以獲取一些數據(大文件)。 Ingress 向 Storage 發送請求,獲取 Client 需要的數據。 也許,有人可以告訴我可以使用什么來將響應從存儲重新流式傳輸到客戶端而不會出現內存不足問題。 現在我已經將 ...

Mocking restTemplate 返回 null

[英]Mocking restTemplate returns null

出於某種原因,以下測試失敗,因為“響應”是 null,但它不應該,因為我使用 when() function 返回初始化的 object。知道如何解決它嗎? 這是確切的錯誤: 這是測試 class:class UtilsControllerTest { @Mock RestTem ...

Java/Postgres 14 的損壞字符

[英]Broken characters with Java/Postgres 14

我正在消費這個 XML: 如下: 但我在數據庫中看到的是: 在我的 JSON api/frontend 中是: 我已經嘗試對我的 Postgres 數據庫使用ru_RU.UTF-8編碼,並得到與UTF-8相同的結果。 是什么原因造成的? 這個數據庫是相關的還是客戶端/Java 相關,甚至是 Spr ...

RestTemplate 無法反序列化 JSON 數組

[英]RestTemplate cannot deserialize a JSON array

當我嘗試使用 RestTemplate 獲取值列表時,出現錯誤。 我使用 Spring 3.0.0。 由以下原因引起:org.springframework.web.client.RestClientException:在 org.springframework.web.client.HttpMes ...

Spring Boot微服務-JUnit測試中RestTemplate空指針異常

[英]Spring Boot Microservices - RestTemplate Null Pointer Exception in JUnit Test

我在我的spring-boot微服務中運行 Junit 服務時遇到問題。 我定義了從/authenticate/login獲取的不記名令牌。 這是有效的。 我可以通過 Postman 向任何服務發送請求。 復制不記名令牌並在此處定義后,我無法運行測試方法,如下所示。 這是它的測試方法 這是下面顯示的 ...

獲取 null 值作為 restTemplate 調用中的響應

[英]Getting null values as response in restTemplate call

我正在 springboot 應用程序中進行 resttemplate 調用。 僅在“狀態”字段中獲取響應數據。 解析后的 object 'payload' 的所有值為 null 以下是來自 Postman 的響應。它包含所有數據。 我在瀏覽器中嘗試了相同的操作並得到了類似的響應。 這是一個 htt ...

JUnit5: restTemplate 交換方法 mocking

[英]JUnit5 : restTemplate exchange method mocking

我正在嘗試在方法內部模擬方法調用: 我嘗試了 mocking 我的測試方法中的restTemplate.exchange()方法,但它仍然調用真正的交換方法。 請提出建議,我該如何模擬那條線。 ...

使用 resttemplate 從 spring-boot 中的 Graph API 獲取圖像時出錯

[英]Error in getting image from Graph API in spring-boot with resttemplate

我正在使用圖表 api: 使用我的訪問令牌獲取特定用戶的個人資料照片。 在 postman 中,我可以使用上面的 get 調用看到圖像。 在我的 spring-boot 應用程序中,我使用如下: 我收到以下錯誤: 我已經將 RestTemplate 定義為: 有人可以幫我解決這個問題嗎? ...

Mocking RestTemplate 交換返回 null

[英]Mocking RestTemplate exchange returns null

我在這里查看了多個帖子 - 例如一個並嘗試了多種變體,但在 mocking 之后似乎仍然無法獲得非空值 RestTemplate#exchange(String url, HttpMethod method, HttpEntity<?> requestEntity, Class< ...

從響應實體中提取 Object

[英]Extract Object From Response Entity

我正在努力通過 Rest 模板訪問 API,並且我已成功收到 responseEntity 表單中的響應。 現在我的要求是從對我的 object 的響應中提取值。 我有 JSON 形式的回應 我有我的 object 這是 我的要求是獲取payload中的值並將它們存儲在channelItem中。 ...

有什么方法可以跳過不兼容的 class 成員的反序列化?

[英]Any way to skip deserialization of class members which are incompatible?

我正在通過 RestTemplate 調用外部 API。 響應結構中有一個參數是動態的,即返回兩種類型的值,成功時返回 Json 結構(status = true),失敗時返回空字符串“”(status = false)。 RestTemplate 在失敗情況下拋出異常,因為字符串無法反序列化到 ...

從 controller 中的另一種方法查詢時,JPA 實體未更新

[英]JPA entity not updated when querying from another method in controller

我是 Spring-boot 和 Spring JPA 框架的新手。 我有一個持久的 JPA 實體(“activeNode”)與另一個持久的 JPA 實體(“activeAudience”)具有一對多關系。 在我的 controller 函數之一中,在為每個函數創建兩個實例之后,我將 activeA ...


 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM