Skip to content

Commit 6f3ed90

Browse files
authored
Update README.md
1 parent 20f5e5f commit 6f3ed90

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,14 @@ function useCrossDomainProxy(event, jqxhr, options)
105105

106106
// Later, somewhere else, it's now much cleaner to do a cross-origin request
107107
$.ajax({
108-
url: 'proxy.php',
109-
data: {a:1, b:2},
108+
method: 'POST',
109+
url: 'http://example.com/some-api',
110+
data: {name: 'Alice', age: 17},
110111
})
111112

112113
```
113114

114-
When using `cache:false` jQuery adds a `_` GET parameter to the URL with the current timestamp to prevent the browser from returning a cached response. This happens *before* the `ajaxSend` event, so in the above case, if you had set `cache:false`, that `_` parameter would just be "moved" to the `X-Proxy-URL` header and no longer have any effect. So instead, leave `cache` at its default value `true`, and add the parameter manually to the proxy url instead.
115+
When using `cache:false` jQuery adds a `_` GET parameter to the URL with the current timestamp to prevent the browser from returning a cached response. This happens *before* the `ajaxSend` event, so in the above case, if you had set `cache:false`, that `_` parameter would just be "moved" to the `X-Proxy-URL` header and no longer have any effect. Instead, leave `cache` at its default value `true`, and add the parameter manually to the proxy url instead, like in the example above.
115116

116117
*Some more examples can be found in [test/index.html](test/index.html).*
117118

0 commit comments

Comments
 (0)