Skip to content

requestbin/curlconverter

Repository files navigation

πŸ”„ cURL Converter

Deploy with Vercel License: MIT Astro GitHub stars

Convert cURL commands to code in 14+ programming languages - Fast, secure, and runs entirely in your browser. No server-side processing, no data collection.

🌐 Live Demo: curlconverter.net


✨ Features

  • πŸš€ 14+ Languages Supported - Python, JavaScript, Node.js, Go, PHP, Java, C#, Rust, Swift, Dart, Perl, PowerShell, Wget, and cURL formatter
  • πŸ“¦ Multiple Library Variants - Each language supports multiple popular HTTP libraries (e.g., Python: Requests & HTTP Client)
  • 🎨 Modern UI/UX - Clean, professional design with gradient accents and smooth animations
  • ⚑ Instant Conversion - Real-time code generation with 300ms debounce
  • πŸ”’ 100% Client-Side - All processing happens in your browser, no data sent to servers
  • πŸ“± Responsive Design - Works seamlessly on desktop, tablet, and mobile
  • 🎯 Quick Examples - Pre-built examples for GET, POST, PUT, DELETE, Form Data, and Custom Headers
  • πŸ”— SEO Optimized - Individual pages for each language (/python, /javascript, etc.)
  • πŸŽͺ RequestBin Integration - One-click "Open in RequestBin" for live testing

🎯 Supported Languages & Libraries

Language Libraries/Variants
Python Requests, HTTP Client
JavaScript Fetch API, XMLHttpRequest
Node.js Native HTTP, Axios, Got
Go HTTP, Resty
PHP cURL, Guzzle
Java HttpClient, OkHttp, HttpURLConnection
C# HttpClient, RestSharp
Rust Reqwest, Ureq
Swift URLSession, Alamofire
Dart HTTP, Dio
Perl LWP, HTTP::Tiny
PowerShell Invoke-WebRequest, Invoke-RestMethod
Wget Standard, Mirror
cURL Windows CMD, PowerShell

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ and npm
  • Modern web browser

Installation

# Clone the repository
git clone https://github.com/requestbin/curlconverter.git
cd curlconverter

# Install dependencies
npm install

# Start development server
npm run dev

The app will be available at http://localhost:4321

Build for Production

# Build static site
npm run build

# Preview production build
npm run preview

πŸ“ Project Structure

curlconverter-net/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ ConverterIsland.tsx    # Main converter UI (React island)
β”‚   β”‚   └── CtaOpenInRequestBin.tsx # RequestBin integration
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ generators/             # Code generators for all languages
β”‚   β”‚   β”‚   β”œβ”€β”€ index.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ python.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ javascript.ts
β”‚   β”‚   β”‚   └── ... (14 generators)
β”‚   β”‚   β”œβ”€β”€ curlconverter.ts        # cURL parser
β”‚   β”‚   β”œβ”€β”€ languages.ts            # Language metadata
β”‚   β”‚   └── examples.ts             # Quick example templates
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ _layout.astro           # Global layout
β”‚   β”‚   β”œβ”€β”€ index.astro             # Homepage
β”‚   β”‚   β”œβ”€β”€ python.astro            # Language-specific pages
β”‚   β”‚   β”œβ”€β”€ javascript.astro
β”‚   β”‚   └── ... (14 language pages)
β”‚   └── styles/
β”‚       └── global.css              # Global styles + Tailwind
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ robots.txt
β”‚   └── sitemap.xml
β”œβ”€β”€ astro.config.mjs                # Astro configuration
β”œβ”€β”€ tailwind.config.cjs             # Tailwind CSS config
└── package.json

πŸ› οΈ Tech Stack

  • Astro - Static Site Generator with Islands architecture
  • React - Interactive UI components
  • TypeScript - Type-safe development
  • Tailwind CSS - Utility-first styling
  • Vercel - Deployment platform

🎨 Design Philosophy

Browser-First Processing

All cURL parsing and code generation happens entirely in the browser using TypeScript. No backend servers, no API calls, no data collection.

SEO-Friendly Architecture

Each programming language has a dedicated page (/python, /javascript, etc.) with optimized meta tags and structured content for better search engine visibility.

Modern UX Patterns

  • Tab-based Variants - Switch between library implementations seamlessly
  • Quick Examples - Pre-built examples for common HTTP methods
  • Real-time Conversion - Instant feedback with debounced updates
  • Copy to Clipboard - One-click code copying
  • Responsive Layout - Mobile-first design principles

🀝 Contributing

Contributions are welcome! Here's how you can help:

Adding a New Language

  1. Create generator in src/lib/generators/yourlang.ts:
import type { Request } from '../curlconverter';

export function generateYourLangLibrary1(request: Request): string {
  // Implementation
  return `// Generated code`;
}

export function generateYourLangLibrary2(request: Request): string {
  // Alternative library implementation
  return `// Generated code`;
}
  1. Export generators in src/lib/generators/index.ts:
export async function getYourLangGenerators() {
  const { generateYourLangLibrary1, generateYourLangLibrary2 } = await import('./yourlang');
  return {
    'Library 1': generateYourLangLibrary1,
    'Library 2': generateYourLangLibrary2,
  };
}
  1. Add language metadata to src/lib/languages.ts:
export const TARGETS = [
  // ... existing languages
  { value: 'yourlang', label: 'Your Language', icon: 'πŸ”·' },
] as const;
  1. Create language-specific page src/pages/yourlang.astro

  2. Update sitemap.xml with new URL

Development Guidelines

  • Use TypeScript for type safety
  • Follow existing code structure and naming conventions
  • Test generators with various cURL commands
  • Ensure responsive design on mobile devices
  • Add JSDoc comments for public functions

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

  • Inspired by the original curlconverter project
  • Built with ❀️ for the developer community
  • Part of the RequestBin ecosystem

πŸ”— Related Projects

  • RequestBin - Inspect HTTP requests with custom endpoints

πŸ“§ Support


Made with β˜• and ⚑ by the RequestBin Team

Website β€’ RequestBin β€’ Report Bug

About

Source code of curlconverter.net

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published