You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _includes/cloudcode/cloud-code-advanced.md
+16-3Lines changed: 16 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ A simple GET request would look like:
8
8
9
9
```javascript
10
10
Parse.Cloud.httpRequest({
11
-
url:'http://www.awesomewebsite.com/'
11
+
url:'https://www.awesomewebsite.com/'
12
12
}).then(function(httpResponse) {
13
13
// success
14
14
console.log(httpResponse.text);
@@ -24,7 +24,7 @@ A GET request that specifies the port number would look like:
24
24
25
25
```javascript
26
26
Parse.Cloud.httpRequest({
27
-
url:'http://www.awesomewebsite.com:8080/'
27
+
url:'https://www.awesomewebsite.com:8080/'
28
28
}).then(function(httpResponse) {
29
29
console.log(httpResponse.text);
30
30
}, function(httpResponse) {
@@ -34,6 +34,19 @@ Parse.Cloud.httpRequest({
34
34
35
35
Valid port numbers are 80, 443, and all numbers from 1025 through 65535.
36
36
37
+
By default, `Parse.Cloud.httpRequest` does not follow redirects caused by HTTP 3xx response codes, the `followRedirects: true` option can be used to change this.
38
+
39
+
```javascript
40
+
Parse.Cloud.httpRequest({
41
+
url:'https://www.awesomewebsite.com/',
42
+
followRedirects:true
43
+
}).then(function(httpResponse) {
44
+
console.log(httpResponse.text);
45
+
}, function(httpResponse) {
46
+
console.error('Request failed with response code '+httpResponse.status);
47
+
});
48
+
```
49
+
37
50
### Query Parameters
38
51
39
52
You can specify query parameters to append to the end of the url by setting `params` on the options object. You can either pass a JSON object of key value pairs like:
By default, Parse Config parameters can be publicly read which may be undesired if the parameter contains sensitive information that should not be exposed to clients. A parameter can be made readable only with the master key by setting the `Requires master key?` property via the Parse Dashboard to `Yes`.
594
+
By default, Parse Config parameters can be publicly read which may be undesired if the parameter contains sensitive information that should not be exposed to clients. A parameter can be made readable only with the master key by setting the `Requires master key?` property via the Parse Dashboard to `Yes`.
0 commit comments