For minor connections, solder is sufficient. A plug wire's center lead is often folded back over the outside of the insulation, touching the crimped termination by half an inch or more. That's a lot of links. You can't melt this kind of wire with a standard soldering iron.
The connection must be good enough to hold pressure during driving, so don't make it too short. According to Edmunds, "the best practice is to leave at least 1/4-inch of wire exposed beyond the body of the connector for proper strain relief."
The connector will also need to be large enough to fit over the headlight beam splitter or other component. This is usually about an eighth of an inch in diameter, so again, don't make the connection too short.
If you do decide to solder your own wiring, use heat-shrink tubing and heavy-duty connectors. It's not difficult, but you do need to pay attention to detail.
As the previous responses have demonstrated, this is permissible under code. It's great if you have sufficient strain relief, such as wire clamps where the wire enters the box, but solder connections are far less tolerant of poor strain relief than other connection types. If you don't have sufficient strain relief, or if the work area gets wet, you may experience a short that could start a fire.
The best way to avoid problems with soldered connections is to use proper strain relief and work in a dry location. You should also use caution not to apply too much heat when using solder. If you do, the metal from the circuit board will be able to melt away, leaving only the solder connection behind. This is called "solder remelting" and it's important to prevent because it can lead to corrosion of the metal parts of the circuit board.
In conclusion, while it is permissible to use solder for some connections, due care must be taken by following safe practices to ensure its safety.
This is how I do a t-splice (connecting a new wire to an existing wire) without using solder. All you need are the wires you wish to splice and some good electrical tape, or even better, heat shrink tubing or self-fusing tape. It is preferable to solder, but if you don't have any, this approach works well and is robust. I hope this is useful to someone. Here's what you do: First, check the insulation on both wires you want to connect. If it is still intact, you can simply cut it with a sharp knife. You will then have two bare wires inside the outer sheath of one of the cables. Next, strip about 1/4 inch (6 mm) off each end of both wires. Finally, fold them back over themselves about 1/4 inch (6 mm) and attach them with more tape. Voila! You now have a t-spliced cable assembly that can be used in any terminal block or wiring box without further modification.
The solder used to make electrical connections must also have favorable electrical properties. Soft solder is extensively used in electronics, plumbing, and sheet metal work and has a melting point range of 90 to 450 °C (190 to 840 °F; 360 to 720 K). Hard solder has a melting point of over 450 °C (840 °F), while silver solder has a melting point of 960 °C (1700 °F). The main types of soft solder are: braze-soldering with alloys such as tin-lead or zinc-silver, wave soldering with rosin cores and metals such as sodium or potassium, and furnace-soldering with metals such as zinc or copper.
Solder wires are thin strands of solder used to join components together or to other materials, including printed wiring boards. They are commonly made from high-purity metals that will not oxidize at room temperature, such as sterling silver or gold-plated steel. Solder wires can be difficult to handle because they are very brittle. When working with them, care should be taken not to break them off prematurely before completing their intended use.
The two main uses for solder wires are to connect components during assembly of an electronic device and to repair faulty connections on a printed circuit board. Both tasks require heating the parts sufficiently to melt the solder so that it flows between them.
To solder AC lines, choose sturdy wires that will not do any harm. Apply the solder evenly over the joints. Partially soldering is not recommended since it may cause the solder to fail. Heat the wire with a torch or a hair dryer until it melts, then let it cool off before attaching it to something. The heater should be kept away from any source of heat or fire.
It is recommended to use solid core wiring for soldering purposes. These can be identified by their white/yellow color coding. If you are using stranded cable, only connect the black and red strands together for your circuit. Leave all other strands isolated. This will prevent electrical interference with other devices in close proximity to your soldering project.
AC power carries a lot of voltage but very little current. Depending on what type of appliance you are connecting to your circuit, either #14 or #12 copper wire will work fine for bonding together the hot and neutral sides of the supply line. Just make sure that you don't have any sharp objects that could poke through your insulation if you use thinner wire. Thicker wire can handle more tension without breaking.
You should also plan ahead to avoid having too many appliances connected to one circuit.