api's People
Forkers
botopolo sousatg-forks ildysilva zdevy panchambharadwaj xyzscratcher gdg4dev shuboxthewar mozz01 engineer152api's Issues
Hitting API responses back with my application html
Trying to Create an Application with this API, but the response is not the one I get when hitting form Thunder Client or Postman.
The request sent:
let headersList = {
"Accept": "*/*",
}
let reqOptions = {
url: "csclub.uwaterloo.ca/~phthakka/1pt/addURL.php?url=google.com&cu",
method: "GET",
headers: headersList,
}
let response = await axios.request(reqOptions);
console.log(response.data);
The Console log:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="URL Shortener"
/>
<link rel="manifest" href="/manifest.json" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
<title>React App</title>
<script defer src="/static/js/bundle.js"></script></head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" crossorigin="anonymous"></script>
</body>
</html>
Add Docker deployment mode
I am a developer from China, and it is not very convenient to use Google
to deploy by myself. Will the author consider creating a Docker
deployment method?
Random short is generated if the given short already exists
>>> r = requests.get("https://api.1pt.co/addURL", params={"long": "https://github.com/rpdelaney", "short": "rpdgh"})
>>> r.json()
{'status': 201, 'message': 'Added!', 'short': 'rpdgh', 'long': 'https://github.com/rpdelaney'}
>>> r = requests.get("https://api.1pt.co/addURL", params={"long": "https://doesnot.exist.com", "short": "rpdgh"})
>>> r.json()
{"status": 201, "message": "Added!", "short": "pqgku", "long": "https://doesnot.exist.com"}
I expect an error from the second request, since the given short already exists. Instead, a URL with a random short is created.
API 503
Could you check it please? got 503
curl -X POST "https://csclub.uwaterloo.ca/~phthakka/1pt-express/addURL?long=https://www.param.me"
HTTP/2 503
strict-transport-security: max-age=26784000
cache-control: private, max-age=0, must-revalidate
content-length: 385
content-type: text/html; charset=iso-8859-1
date: Mon, 11 Sep 2023 06:53:39 GMT
server: Apache/2.4.57 (Debian)
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>503 Service Unavailable</title>
</head><body>
<h1>Service Unavailable</h1>
<p>The server is temporarily unable to service your
request due to maintenance downtime or capacity
problems. Please try again later.</p>
<hr>
<address>Apache/2.4.57 (Debian) Server at csclub.uwaterloo.ca Port 443</address>
</body></html>
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.