Skip to content

Commit 7ca65c8

Browse files
committed
pass query params directly
1 parent 3469001 commit 7ca65c8

File tree

6 files changed

+6
-18
lines changed

6 files changed

+6
-18
lines changed

src/api/pagination/cursor-request/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
const https = require('https')
22

3-
const use_cursor = true;
4-
const perPage = 50;
53
const options = {
64
hostname: 'api.paystack.co',
75
port: 443,
8-
path: `/transaction?use_cursor=${use_cursor}&perPage=${perPage}`,
6+
path: `/transaction?use_cursor=true&perPage=50`,
97
method: 'GET',
108
headers: {
119
Authorization: 'Bearer YOUR_SECRET_KEY'

src/api/pagination/cursor-request/index.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<?php
2-
$use_cursor = true;
3-
$perPage = 50;
42
$curl = curl_init();
53

64
curl_setopt_array($curl, array(
7-
CURLOPT_URL => "https://api.paystack.co/transaction?use_cursor=$use_cursor&perPage=$perPage",
5+
CURLOPT_URL => "https://api.paystack.co/transaction?use_cursor=true&perPage=50",
86
CURLOPT_RETURNTRANSFER => true,
97
CURLOPT_ENCODING => "",
108
CURLOPT_MAXREDIRS => 10,
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/bin/sh
2-
use_cursor="true"
3-
perPage="50"
4-
url="https://api.paystack.co/transaction?use_cursor=$use_cursor&perPage=$perPage"
2+
url="https://api.paystack.co/transaction?use_cursor=true&perPage=50"
53
authorization="Authorization: Bearer YOUR_SECRET_KEY"
64

75
curl "$url" -H "$authorization" -X GET

src/api/pagination/offset-request/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
const https = require('https')
22

3-
const page = 1;
4-
const perPage = 50;
53
const options = {
64
hostname: 'api.paystack.co',
75
port: 443,
8-
path: `/transaction?page=${page}&perPage=${perPage}`,
6+
path: `/transaction?page=1&perPage=50`,
97
method: 'GET',
108
headers: {
119
Authorization: 'Bearer SECRET_KEY'

src/api/pagination/offset-request/index.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
<?php
2-
$page = 1;
3-
$perPage = 50;
42
$curl = curl_init();
53

64
curl_setopt_array($curl, array(
7-
CURLOPT_URL => "https://api.paystack.co/transaction?page=$page&perPage=$perPage",
5+
CURLOPT_URL => "https://api.paystack.co/transaction?page=1&perPage=50",
86
CURLOPT_RETURNTRANSFER => true,
97
CURLOPT_ENCODING => "",
108
CURLOPT_MAXREDIRS => 10,
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/bin/sh
2-
page="1"
3-
perPage="50"
4-
url="https://api.paystack.co/transaction?page=$page&perPage=$perPage"
2+
url="https://api.paystack.co/transaction?page=1&perPage=50"
53
authorization="Authorization: Bearer YOUR_SECRET_KEY"
64

75
curl "$url" -H "$authorization" -X GET

0 commit comments

Comments
 (0)