HTTP 40, Error url
During encoding a URL, the characters may not be present on
the keyboard. Another time, the characters of any URL might not be usable in any
context where it can conflict with already reserved characters. In any case,
the characters can be encoded with any
%
followed by its equivalent ASCII hexadecimal code.
|
|
Some example as follows:
http://www.rpi.edu/%7Edecemj/
will be same as http://www.rpi.edu/~decemj/
Percent encoding, also known as the URL encoding,
is a mechanism for the encoding of information in a Uniform Resource Identifier
(URI) under confirm circumstances. Although it is already recognized as URL
encoding it is, in fact, used more simply with in the set of main Uniform
Resource Identifier (URI), which contains both Uniform Resource Name (URN) and Uniform
Resource Locator (URL). As such as, it can also used in the grounding of record
of the
application/x-www-form-urlencoded
type of
media, as is generally used in the compliance of HTML form
data in to the requests of HTTP.
Q: We are opening
the Http Connections to download the images, we doing it as code written below.
but when we call getResponseCode() function , Exception generated.
We are using the S40 6th Edition SDK along With the Netbeans.
HttpConnection httpConn =null;
InputStream is= null;
httpConn= (HttpConnection) Connector.open(url);
httpConn.setRequestMethod (HttpConnection.GET);
if((httpConn.getResponseCode()== HttpConnection.HTTP_OK)) { // Exception Generated at this point
int length= (int)httpConn.getLength ();
is= httpConn.openInput Stream();
We are using the S40 6th Edition SDK along With the Netbeans.
HttpConnection httpConn =null;
InputStream is= null;
httpConn= (HttpConnection) Connector.open(url);
httpConn.setRequestMethod (HttpConnection.GET);
if((httpConn.getResponseCode()== HttpConnection.HTTP_OK)) { // Exception Generated at this point
int length= (int)httpConn.getLength ();
is= httpConn.openInput Stream();
Response: First
confirm that our GPRS Connections are working fine or not? So first Test our
native web browsers are that working fine. Then test our admittance point
setting for the applications? Which
connections are using by it the same connections which are using for the
default web browsers? It is not set that for our applications.
Are our servers are alive from where we are downloading the images .
Confirm all these points first!
Are our servers are alive from where we are downloading the images .
Confirm all these points first!
URI characters Types
The character permitted in any URI is either unreserved or reserved
(or a percent characters as part of a percent encoding). Reserved character is
that character that has sometimes particular meaning. For an example, forward
slash character is used to divide the different parts of an URL (or more simply,
an URI). Unreserved character has no such type of meaning. Using the percent encoding,
reserved character is represent the using sequences of special characters. The
set of unreserved characters and reserved and the circumstance under which confident
reserved character has special meaning have slightly changed with each amendment
of specification that govern the URIs and schemes of URI.
! | * | ' | ( | ) | ; | : | @ | & | = | + | $ | , | / | ? | # | [ |
] |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
|
a |
b |
c |
d |
e |
f |
g |
h |
i |
j |
k |
l |
m |
n |
o |
p |
q |
r |
s |
t |
u |
v |
w |
x |
y |
z |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
- |
_ |
. |
~ |
Percent encoding reserved characters
When any characters from the reserved character set (few "reserved
characters") has particular meaning (a "reserved purpose") in a confident
situation, and a scheme of URI says that it is urgent to use that characters
for some another reason, then the characters must be percent encoded.
Percent encoding are reserved characters involve converting the characters to
its corresponding value equal to byte in ASCII and then representing that values
as a hexadecimal digits set. The digit, preceded by a sign of percent ("
%
") which are used as an escape
characters, are then used in the URI in the places of the reserved characters.
(For a non ASCII characters, it is typically converted into its sequence of
byte in UTF - 8, and then each bytes value are represented as provided upward.)
The reserved characters "
/
",
for an example, if we used in the "path" like the components of any
URI, URL’s have the special meaning of getting any delimiter between the segments
of path. If, according to a provided scheme URI, "/
" requires to be in the
path segment, then the three characters given ahead as "%2f
" or "%2F
" must be used in the segment in
its place of a unprocessed "/
".
Reserved characters
after percent-encoding
|
|||||||||||||||||
! |
# |
$ |
& |
' |
( |
) |
* |
+ |
, |
/ |
: |
; |
= |
? |
@ |
[ |
] |
%21 |
%23 |
%24 |
%26 |
%27 |
%28 |
%29 |
%2A |
%2B |
%2C |
%2F |
%3A |
%3B |
%3D |
%3F |
%40 |
%5B |
%5D |
Reserved character that has no reserved reason in a specific context may
also be percent encoded but are not semantically variant from those which is
not available.
BlackBerry to Cut 40% of Work Force After Big Loss
No comments:
Post a Comment