tags:

views:

46

answers:

1

So I have this cURL script for remote login. It works fine for some pages but not the pages I need.

For the page that isn't accessible through the script, the remote server requires the url be like this:

  https://sub.example.com/a/b/thisPage.aspx?aVar=%2Fa%2Fb%2Fc%2Fd%2FFile+Name.nev

It seems that cURL or just php automatically converts the last part to

  ... thisPage.aspx?aVar=/a/b/c/d/File+Name.nev

I have php echo out the url variable just before it is passed to cURL and the last part is:

  ...thisPage.aspx?aVar=%2Fa%2Fb%2Fc%2Fd%2FFile+Name.nev 

but it gives an error message "Bad Request" and the browser url shows:

  ...thisPage.aspx?aVar=/a/b/c/d/File+Name.nev

When I manually enter enter ... thisPage.aspx?aVar=%2Fa%2Fb%2Fc%2Fd%2FFile+Name.nev in my browser it pulls up the page just fine.

+1  A: 

Try double encoding so that way the % are encoded to. Try replacing them with %25.

Aaron Harun