質問編集履歴
3
試したこと追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
|
9
|
+
【試したこと1】
|
10
10
|
|
11
11
|
以下のように、参考サイトの通りにProximoの固定IPが返ってくるのか試してみるところから始めたところ、kintoneからは500エラーが返ってきてしまい、先に進めそうにないです。
|
12
12
|
|
@@ -96,11 +96,67 @@
|
|
96
96
|
|
97
97
|
```
|
98
98
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
99
|
+
【試したこと2】
|
100
|
+
|
101
|
+
[公式ドキュメント](https://docs.guzzlephp.org/en/stable/request-options.html#proxy)にはこのような↓ことが書かれておりまました。[こちら](https://technoledge.net/composer-guzzle/)を参考に試してみましたが、403エラーになってしまいました。usernameとpasswordにはkitnoneのものを使えば良いかと考えましたが間違っているのでしょうか。proximoが発行したURLのproxy:passwordはどう扱えば良いのかもわかりません。
|
102
|
+
|
103
|
+
```
|
104
|
+
|
105
|
+
You can provide proxy URLs that contain a scheme, username, and password. For example, "http://username:password@192.168.16.1:10".
|
106
|
+
|
107
|
+
```
|
108
|
+
|
109
|
+
試したソース
|
110
|
+
|
111
|
+
```
|
112
|
+
|
113
|
+
public function GetData ($query) {
|
114
|
+
|
115
|
+
// インスタンス作成
|
116
|
+
|
117
|
+
$client = new Client();
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
$options = [
|
122
|
+
|
123
|
+
// Basic認証
|
124
|
+
|
125
|
+
'auth' => ['kintoneUser', 'Password'],
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
// プロキシ設定
|
130
|
+
|
131
|
+
'proxy' => 'http://proxy:xxxxxxx@proxy-xxx-xxx-xxx-xxx.proximo.io' . ':80',
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
// SSL証明書を検証しない
|
136
|
+
|
137
|
+
'verify' => false,
|
138
|
+
|
139
|
+
];
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
// リクエスト送信
|
144
|
+
|
145
|
+
$response = $client->request('GET', 'https://208gxyhcxfg3.cybozu.com/k/v1/record.json?app=337&id=58412', $options);
|
146
|
+
|
147
|
+
print_r($res->getStatusCode());exit();
|
148
|
+
|
149
|
+
}
|
150
|
+
|
151
|
+
```
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
【やりたいこと】
|
104
160
|
|
105
161
|
最終的には以下の内容をproxi経由でGET送信とPOST送信したいのですがどう書けば良いか変わりません。
|
106
162
|
|
2
初心者マーク追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -102,7 +102,7 @@
|
|
102
102
|
|
103
103
|
|
104
104
|
|
105
|
-
最終的には以下の内容をproxi経由でGET送信とPOST送信したいのですが
|
105
|
+
最終的には以下の内容をproxi経由でGET送信とPOST送信したいのですがどう書けば良いか変わりません。
|
106
106
|
|
107
107
|
そうかご教授お願い致します。
|
108
108
|
|
1
誤記訂正
test
CHANGED
File without changes
|
test
CHANGED
@@ -58,15 +58,15 @@
|
|
58
58
|
|
59
59
|
if ($list) {
|
60
60
|
|
61
|
-
$response['
|
61
|
+
$response['kintoneError'] = $list;
|
62
|
-
|
62
|
+
|
63
|
-
$this->log("
|
63
|
+
$this->log("kintoneError error:".print_r($response, true));exit();
|
64
64
|
|
65
65
|
}else{
|
66
66
|
|
67
|
-
$response['
|
67
|
+
$response['kintoneError'] = $res->getStatusCode();
|
68
|
-
|
68
|
+
|
69
|
-
$this->log("
|
69
|
+
$this->log("kintoneError error:".print_r($response, true));exit();
|
70
70
|
|
71
71
|
}
|
72
72
|
|
@@ -78,9 +78,9 @@
|
|
78
78
|
|
79
79
|
} catch (Exception $e){
|
80
80
|
|
81
|
-
$this->log("
|
81
|
+
$this->log("kintoneError error:" . print_r(json_decode($e->getResponse()->getBody()->getContents())));
|
82
|
-
|
82
|
+
|
83
|
-
$this->log("
|
83
|
+
$this->log("kintoneError error:" . print_r($e->getMessage()));
|
84
84
|
|
85
85
|
die($e->getMessage());
|
86
86
|
|
@@ -154,15 +154,15 @@
|
|
154
154
|
|
155
155
|
if ($list) {
|
156
156
|
|
157
|
-
$response['
|
157
|
+
$response['kintoneError'] = $list;
|
158
|
-
|
158
|
+
|
159
|
-
$this->log("
|
159
|
+
$this->log("kintoneError error:".print_r($response, true));exit();
|
160
160
|
|
161
161
|
}else{
|
162
162
|
|
163
|
-
$response['
|
163
|
+
$response['kintoneError'] = $res->getStatusCode();
|
164
|
-
|
164
|
+
|
165
|
-
$this->log("
|
165
|
+
$this->log("kintoneError error:".print_r($response, true));exit();
|
166
166
|
|
167
167
|
}
|
168
168
|
|
@@ -174,9 +174,9 @@
|
|
174
174
|
|
175
175
|
} catch (Exception $e){
|
176
176
|
|
177
|
-
$this->log("
|
177
|
+
$this->log("kintoneError error:" . print_r(json_decode($e->getResponse()->getBody()->getContents())));
|
178
|
-
|
178
|
+
|
179
|
-
$this->log("
|
179
|
+
$this->log("kintoneError error:" . print_r($e->getMessage()));
|
180
180
|
|
181
181
|
}
|
182
182
|
|
@@ -234,17 +234,17 @@
|
|
234
234
|
|
235
235
|
if ($list) {
|
236
236
|
|
237
|
-
$response['
|
237
|
+
$response['kintoneError'] = $list;
|
238
|
-
|
238
|
+
|
239
|
-
$this->log("
|
239
|
+
$this->log("kintoneError error:".print_r($response, true));
|
240
240
|
|
241
241
|
exit();
|
242
242
|
|
243
243
|
}else{
|
244
244
|
|
245
|
-
$response['
|
245
|
+
$response['kintoneError'] = $res->getStatusCode();
|
246
|
-
|
246
|
+
|
247
|
-
$this->log("
|
247
|
+
$this->log("kintoneError error:".print_r($response, true));exit();
|
248
248
|
|
249
249
|
}
|
250
250
|
|
@@ -256,9 +256,9 @@
|
|
256
256
|
|
257
257
|
} catch (Exception $e){
|
258
258
|
|
259
|
-
$this->log("
|
259
|
+
$this->log("kintoneError error:" . print_r(json_decode($e->getResponse()->getBody()->getContents())));
|
260
|
-
|
260
|
+
|
261
|
-
$this->log("
|
261
|
+
$this->log("kintoneError error:" .$e->getMessage());
|
262
262
|
|
263
263
|
}
|
264
264
|
|