Lost
Lost

Reputation: 13615

Reading URL with # instead of ? in it

I am workign with OAuth2 and and I am calling Google API. Google returns results after call is complete and I am supposed to read from the query parameters. Now, the kind of URL that Google Returns is weird and it has anchor # in it exactly where there should be a ?

and URL looks something like

http://localhost.contestfactory.com/enduser/#state=MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAw&access_token=ya29.AHES6ZTjWwx7hHO4WnmfQ_lwJSpATCqA_DUZCC_ZIjdyPWA96OS0EN0&token_type=Bearer&expires_in=3600

Because of # in the URL my C# code fails to read beyond #. Is there anyway I can deal this problem in C#?

Upvotes: 1

Views: 194

Answers (2)

Parv Sharma
Parv Sharma

Reputation: 12705

what ur saying looks like hash fragment.. and it is never sen tto the server. what u can do instead make a JS script that changes all the "#" to "?" that way they will be treated as query string and will be sent to the server

Upvotes: 2

SLaks
SLaks

Reputation: 887547

The part after the # is called the URL fragment (or hash).

It is never sent to the server.

Upvotes: 6

Related Questions