-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
11
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Though we encountered on Linux, it is probably there in other OS also
A DESCRIPTION OF THE PROBLEM :
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class HttpClientTester {
public static void main(String[] args) throws IOException, InterruptedException {
HttpClient client = HttpClient.newBuilder()
.version(HttpClient.Version.HTTP_2)
.build();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.businesscentral.dynamics.com/v2.0/42914ade-62f3-4ec3-8e38-ecba9eb3e314/sandbox/api/v2.0/companies(10a127a4-77ff-eb11-bb73-000d3a2b9e0a)/items?$filter=type%20eq%20'Inventory'&$select=number,displayName,type,itemCategoryId,itemCategoryCode,inventory,unitPrice,taxGroupCode&$top=100"))
.header("Content-Type", "application/json")
.build();
HttpResponse<String> send = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(send.body());
}
}
---------------------------------------------------------------------------------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request</h2>
<hr><p>HTTP Error 400. The request is badly formed.</p>
</BODY></HTML>
REGRESSION : Last worked in version 14
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the below program:
---------------------------------------------------------------------------------------------------------------------------------------------------
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class HttpClientTester {
public static void main(String[] args) throws IOException, InterruptedException {
HttpClient client = HttpClient.newBuilder()
.version(HttpClient.Version.HTTP_2)
.build();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.businesscentral.dynamics.com/v2.0/42914ade-62f3-4ec3-8e38-ecba9eb3e314/sandbox/api/v2.0/companies(10a127a4-77ff-eb11-bb73-000d3a2b9e0a)/items?$filter=type%20eq%20'Inventory'&$select=number,displayName,type,itemCategoryId,itemCategoryCode,inventory,unitPrice,taxGroupCode&$top=100"))
.header("Content-Type", "application/json")
.build();
HttpResponse<String> send = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(send.body());
}
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
<error xmlns="http://docs.oasis-open.org/odata/ns/metadata"><code>Unauthorized</code><message>The credentials provided are incorrect</message></error>
ACTUAL -
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request</h2>
<hr><p>HTTP Error 400. The request is badly formed.</p>
</BODY></HTML>
---------- BEGIN SOURCE ----------
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class HttpClientTester {
public static void main(String[] args) throws IOException, InterruptedException {
HttpClient client = HttpClient.newBuilder()
.version(HttpClient.Version.HTTP_2)
.build();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.businesscentral.dynamics.com/v2.0/42914ade-62f3-4ec3-8e38-ecba9eb3e314/sandbox/api/v2.0/companies(10a127a4-77ff-eb11-bb73-000d3a2b9e0a)/items?$filter=type%20eq%20'Inventory'&$select=number,displayName,type,itemCategoryId,itemCategoryCode,inventory,unitPrice,taxGroupCode&$top=100"))
.header("Content-Type", "application/json")
.build();
HttpResponse<String> send = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(send.body());
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Had to Downgrade to minor version 11.0.13
FREQUENCY : always
Though we encountered on Linux, it is probably there in other OS also
A DESCRIPTION OF THE PROBLEM :
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class HttpClientTester {
public static void main(String[] args) throws IOException, InterruptedException {
HttpClient client = HttpClient.newBuilder()
.version(HttpClient.Version.HTTP_2)
.build();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.businesscentral.dynamics.com/v2.0/42914ade-62f3-4ec3-8e38-ecba9eb3e314/sandbox/api/v2.0/companies(10a127a4-77ff-eb11-bb73-000d3a2b9e0a)/items?$filter=type%20eq%20'Inventory'&$select=number,displayName,type,itemCategoryId,itemCategoryCode,inventory,unitPrice,taxGroupCode&$top=100"))
.header("Content-Type", "application/json")
.build();
HttpResponse<String> send = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(send.body());
}
}
---------------------------------------------------------------------------------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request</h2>
<hr><p>HTTP Error 400. The request is badly formed.</p>
</BODY></HTML>
REGRESSION : Last worked in version 14
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the below program:
---------------------------------------------------------------------------------------------------------------------------------------------------
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class HttpClientTester {
public static void main(String[] args) throws IOException, InterruptedException {
HttpClient client = HttpClient.newBuilder()
.version(HttpClient.Version.HTTP_2)
.build();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.businesscentral.dynamics.com/v2.0/42914ade-62f3-4ec3-8e38-ecba9eb3e314/sandbox/api/v2.0/companies(10a127a4-77ff-eb11-bb73-000d3a2b9e0a)/items?$filter=type%20eq%20'Inventory'&$select=number,displayName,type,itemCategoryId,itemCategoryCode,inventory,unitPrice,taxGroupCode&$top=100"))
.header("Content-Type", "application/json")
.build();
HttpResponse<String> send = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(send.body());
}
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
<error xmlns="http://docs.oasis-open.org/odata/ns/metadata"><code>Unauthorized</code><message>The credentials provided are incorrect</message></error>
ACTUAL -
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request</h2>
<hr><p>HTTP Error 400. The request is badly formed.</p>
</BODY></HTML>
---------- BEGIN SOURCE ----------
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class HttpClientTester {
public static void main(String[] args) throws IOException, InterruptedException {
HttpClient client = HttpClient.newBuilder()
.version(HttpClient.Version.HTTP_2)
.build();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.businesscentral.dynamics.com/v2.0/42914ade-62f3-4ec3-8e38-ecba9eb3e314/sandbox/api/v2.0/companies(10a127a4-77ff-eb11-bb73-000d3a2b9e0a)/items?$filter=type%20eq%20'Inventory'&$select=number,displayName,type,itemCategoryId,itemCategoryCode,inventory,unitPrice,taxGroupCode&$top=100"))
.header("Content-Type", "application/json")
.build();
HttpResponse<String> send = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(send.body());
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Had to Downgrade to minor version 11.0.13
FREQUENCY : always