0

I use file_get_contents to send a request to a web service, let say: https://example.com/mywebservice?arg1=value1&arg2=value2

If value2 is avaluewith#sometextafter, I send: https://example.com/mywebservice?arg1=value1&arg2=avaluewith#sometextafter

My problem is that when the web server processes the request, it gets arg2=avaluewith

The pound character and what is after is lost.

How to correct that?

Eric Malalel
  • 185
  • 1
  • 17

2 Answers2

1

THe URL's hash is never sent to the webserver. It exists solely client-side.

ceejayoz
  • 176,543
  • 40
  • 303
  • 368
0

I added urlencode() to the param which was truncated and it works fine.

Now the full URL with full params is received and processed by the web service.

Eric Malalel
  • 185
  • 1
  • 17