简体   繁体   English

REST请求在RestClient中有效,但在PostMan / Java中无效

[英]REST request works in RestClient but not PostMan/Java

Having a request fail in postman/java but works in RestClient.. here is the request and attached is a screenshot of the error. 在postman / java中有一个请求失败,但在RestClient ..中起作用。这是请求,附件是错误的屏幕截图。

This is a POST request 这是POST请求

{ "username": "test", "password": "test", "simulate_user": "test", "sourcetabledesc": "TestList100", "contacts": [{ "organization": "CKT", "workPhone": "12315423", "firstName": "Tester0", "zip": "1231", "stateProv": "Dasdas", "lastName": "Torrance", "address2": "BlaBlaBla Ble Ble Ble 1231", "address3": "BlaBlaBla Ble Ble Ble 1231", "emailAddress": "test", "contactid": "DS21029", "country": "United States", "title": "Driver", "address1": "BlaBlaBla Ble Ble Ble 1231", "city": "Pepepe" }, { "organization": "CKT", "workPhone": "12315423", "firstName": "Tester1", "zip": "1231", "stateProv": "Dasdas", "lastName": "Torrance", "address2": "BlaBlaBla Ble Ble Ble 1231", "address3": "BlaBlaBla Ble Ble Ble 1231", "emailAddress": "test", "contactid": "DS21029", "country": "United States", "title": "Driver", "address1": "BlaBlaBla Ble Ble Ble 1231", "city": "Pepepe" }] } {“用户名”:“测试”,“密码”:“测试”,“ simulate_user”:“测试”,“ sourcetabledesc”:“ TestList100”,“联系人”:[{“组织”:“ CKT”,“ workPhone” :“” 12315423“,” firstName“:” Tester0“,” zip“:” 1231“,” stateProv“:” Dasdas“,” lastName“:” Torrance“,” address2“:” BlaBlaBla Ble Ble Ble 1231“,” address3”:“ BlaBlaBla Ble Ble Ble 1231”,“ emailAddress”:“ test”,“ contactid”:“ DS21029”,“ country”:“ United States”,“ title”:“ Driver”,“ address1”:“ BlaBlaBla Ble Ble Ble 1231“,” city“:” Pepepe“},{” organization“:” CKT“,” workPhone“:” 12315423“,” firstName“:” Tester1“,” zip“:” 1231“,” stateProv “:” Dasdas“,” lastName“:” Torrance“,” address2“:” BlaBlaBla Ble Ble Ble 1231“,” address3“:” BlaBlaBla Ble Ble Ble 1231“,” emailAddress“:”测试“,” contactid“: “ DS21029”,“国家”:“美国”,“标题”:“驱动程序”,“地址1”:“ BlaBlaBla Ble Ble Ble 1231”,“城市”:“ Pepepe”}]}

在此处输入图片说明

My header is as below: 我的标题如下: 在此处输入图片说明

This is the response i am supposed to get: (Do you think it could be the single quotes in the response causing a conflict?) 这是我应该得到的响应:(您认为它可能是响应中的单引号引起冲突吗?)

{"data": "{'status':'processing','sourcetablename':'SrcAPI_20170714_13888489_7'}", "call": "UNUSED", "api_version": 1, "encoding": "utf-8"} {“ data”:“ {'status':'processing','sourcetablename':'SrcAPI_20170714_13888489_7'}”,“ call”:“ UNUSED”,“ api_version”:1,“ encoding”:“ utf-8”}

One of the reason could be content-type header. 原因之一可能是内容类型标头。 Please check that. 请检查一下。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 POST 请求在 Java 客户端中不起作用,但在 postman 中起作用 - POST request does not work in Java client but works in postman Get 请求适用于 POSTMAN 但在我的 Java 应用程序中引发垃圾响应 - Get request works with POSTMAN but throws garbage response in my Java application REST POST请求不适用于java但适用于REST客户端 - REST POST request not working on java but works on REST client 获取请求在 Postman 中有效,但在 Java 中通过 HttpURLConnection 调用请求时给出 403 - Get Request Works in Postman but gives a 403 When Request is Called through HttpURLConnection in Java Rest API 可以从 Postman 调用,显示来自 ZD52387880E1EA22831817A27 的 400 个错误请求 - Rest API can be called from Postman, shows 400 bad request from Java 在 Postman 的请求正文中传递多个 JSON 数据并使用 Jersy(JXRS) 进入 Java Rest API - Pass multiple JSON data in Request Body of Postman and Get into Java Rest API using Jersy(JXRS) Sending POST request with POSTMAN to Java REST API and getting null values in the xml response - Sending POST request with POSTMAN to Java REST API and getting null values in the xml response Java 从 Angular 发送请求时 HttpParameters getInputStream 方法为空,但从 Postman 发送请求时按预期工作 - Java HttpParameters getInputStream method empty when sending the request from Angular, but works as expected when sending from Postman 如何在 Z03D476861AFD3841110F2CB80CCFA8 中请求 Rest API eclipse 服务? - How to request Rest API eclipse service in postman? GET 请求适用于 Postman,但不适用于 SpringBoot RestTemplate - GET Request Works in Postman but not with SpringBoot RestTemplate
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM