Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
jpol4
Posts: 14
Registered: ‎07-23-2012
My Device: Curve 9300
My Carrier: Claro

HTTP GET recives HTTP_CODE 400

Hi everyone. 

 

I'm back here, BB is alive again.

 

I'm having an issue that's taking me more time than it should.

 

heres the scenario,

I have a service that I call like this:  http://192.168.0.138/Cps.DomainConnector/CpsDomainService.svc/Http/GetCustomersCache?storagedCustome...

 

here everything works fine, but when I supply params, like this:

 http://192.168.0.138/Cps.DomainConnector/CpsDomainService.svc/Http/GetCustomersCache?storagedCustome... 10:50 

 

I get HTTP_CODE 400.

 

Here's the code to make the call:

 

final String url = MessageFormat.format(UrlBase.concat("GetCustomersCache?storagedCustomers={0}&lastupdated={1}"), params);
URLEncodedPostData urlEncoder = new URLEncodedPostData("UTF-8", false);
urlEncoder.setData(url);
String newUrl = urlEncoder.toString();
httpConnection = (HttpConnection) Connector.open(newUrl);
final int responseCode = httpConnection.getResponseCode();

 

I understand that que space inside the Date param should be coded as a %20, but apparently this is not happening, when I paste this URL into my desktop browser I get the expected result.

 

What am I missing?

 

Thanks in advance.

 

JMP

Please use plain text.
New Developer
jpol4
Posts: 14
Registered: ‎07-23-2012
My Device: Curve 9300
My Carrier: Claro

Re: HTTP GET recives HTTP_CODE 400

I can add that the same call, made from .NET over Mono for Android gets the expected result, this is way I don't get what is I'm doing wrong.

 

Greetings.

 

JMP

Please use plain text.