# URL encoding

**URL:** <https://community.gatling.io/t/url-encoding/419>\
**Category:** Gatling (Open-Source)\
**Created:** [June 7, 2013, 6:24pm UTC](https://community.gatling.io/t/url-encoding/419 "2013-06-07T18:24:37Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zique\_Sousa](https://avatars.discourse-cdn.com/v4/letter/z/6f9a4e/32.png) [@Zique\_Sousa](https://community.gatling.io/u/Zique_Sousa)\
**Post date:** [June 7, 2013, 6:24pm UTC](https://community.gatling.io/t/url-encoding/419/1 "2013-06-07T18:24:37Z")

</div>

after running my script, I noticed that I am getting a 404 error message in my log. I think it has to do with URL encoding.  
The URL I am trying to use redirects me to a page that has a “#” in the URL like so [https://server.com/userportal/#/mileage/period/current](https://server.com/userportal/#/mileage/period/current)

in the debug log I noticed that its encoding the “#” and changing it to “23”

[https://server.com/userportal/%23/mileage](https://server.com/userportal/%23/mileage)

Any ideas how I can resolve this issue?

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [June 7, 2013, 9:32pm UTC](https://community.gatling.io/t/url-encoding/419/2 "2013-06-07T21:32:56Z")

</div>

Which version of Gatling do you use? Do you use follow redirect?  
I would have expected the fragment (what comes after the #) to be ignored.

---

<div class="post-metadata">

**Author:** ![Zique\_Sousa](https://avatars.discourse-cdn.com/v4/letter/z/6f9a4e/32.png) [@Zique\_Sousa](https://community.gatling.io/u/Zique_Sousa)\
**Post date:** [June 8, 2013, 2:09am UTC](https://community.gatling.io/t/url-encoding/419/3 "2013-06-08T02:09:24Z")

</div>

I am using gatling-charts-highcharts-1.5.0

---

<div class="post-metadata">

**Author:** ![Zique\_Sousa](https://avatars.discourse-cdn.com/v4/letter/z/6f9a4e/32.png) [@Zique\_Sousa](https://community.gatling.io/u/Zique_Sousa)\
**Post date:** [June 8, 2013, 2:10am UTC](https://community.gatling.io/t/url-encoding/419/4 "2013-06-08T02:10:56Z")

</div>

As for your other question “Do you use follow redirect”, I don’t think I do. Actually, I am not sure. How do I check?

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [June 8, 2013, 6:52am UTC](https://community.gatling.io/t/url-encoding/419/5 "2013-06-08T06:52:37Z")

</div>

I can’t reproduce.  
I checked that a Location header [https://server.com/userportal/#/mileage/period/current](https://server.com/userportal/#/mileage/period/current) is indeed redirected to /userportal and that the fragment is not being sent to the server.

Could you provide more details, please? How is the redirect being done in your application? HTTP redirect?

---

<div class="post-metadata">

**Author:** ![Zique\_Sousa](https://avatars.discourse-cdn.com/v4/letter/z/6f9a4e/32.png) [@Zique\_Sousa](https://community.gatling.io/u/Zique_Sousa)\
**Post date:** [June 10, 2013, 4:25pm UTC](https://community.gatling.io/t/url-encoding/419/6 "2013-06-10T16:25:35Z")

</div>

yes, its HTTPredirect

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [June 10, 2013, 4:48pm UTC](https://community.gatling.io/t/url-encoding/419/7 "2013-06-10T16:48:00Z")

</div>

And you say that your server returns a 30X with a Location header whose value is [https://server.com/userportal/#/mileage/period/current](https://server.com/userportal/#/mileage/period/current), and that Gatling redirects to [https://server.com/userportal/%23/mileage](https://server.com/userportal/%23/mileage), right?

---

<div class="post-metadata">

**Author:** ![Zique\_Sousa](https://avatars.discourse-cdn.com/v4/letter/z/6f9a4e/32.png) [@Zique\_Sousa](https://community.gatling.io/u/Zique_Sousa)\
**Post date:** [June 10, 2013, 7:49pm UTC](https://community.gatling.io/t/url-encoding/419/8 "2013-06-10T19:49:51Z")

</div>

correct

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [June 10, 2013, 8:19pm UTC](https://community.gatling.io/t/url-encoding/419/9 "2013-06-10T20:19:05Z")

</div>

Then I really don’t understand and can’t reproduce.

I just built a test case and here’s what I get:

Response:

HTTP/1.1 303 See Other  
Location: [http://server.com/userportal/#/mileage/period/current](http://server.com/userportal/#/mileage/period/current)  
Content-Length: 0

Request:

GET /userportal/ HTTP/1.1  
Host: [server.com](http://server.com)  
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,_/_;q=0.8  
DNT: 1  
Accept-Language: en-US,en;q=0.5  
Accept-Encoding: gzip  
Connection: keep-alive  
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0

As you can see, and as expected, Gatling doesn’t send the fragment part.

Could you try a proxy tool such as Charles, please?

Proxy Settings to check/enable the proxy ports, then add .proxy(“localhost”, 8888) to your httpConf in your Gatling simulation

see [https://github.com/excilys/gatling/wiki/HTTP#wiki-proxy](https://github.com/excilys/gatling/wiki/HTTP#wiki-proxy)

---

<div class="post-metadata">

**Author:** ![Julian1](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@Julian1](https://community.gatling.io/u/Julian1)\
**Post date:** [November 11, 2015, 6:24am UTC](https://community.gatling.io/t/url-encoding/419/10 "2015-11-11T06:24:09Z")

</div>

Hi Mr. Stephane,

After running my script, log returned several requested resources with 404 response status.  
I am using Gatling 2.1.7 and enabled Follow Redirects. I think what is expected is that 3XX status should be returned when requests are redirected.  
I am confused over the 404 status while resources are actually accessible or “can be found”. Can this be a problem in the connection, the redirection process, or the application itself?  
Please help.

Here’s a segment of the returned log:

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [November 11, 2015, 12:25pm UTC](https://community.gatling.io/t/url-encoding/419/11 "2015-11-11T12:25:50Z")

</div>

Hi Julian,

You have to realize that we cannot help you unless you provide a reproducer, ie a Gatling simulation that we can run so we can investigate. Any simulation sample that can’t be run because you anonymized the urls is pretty useless.

If your application is private and you can’t share, I’m afraid you’re on your own. Then, you should probably get some help from your seniors.

We can help on private applications, but only our customers who purchased a support offer.

Regards,
